{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 上周小结:\n",
    "> * 1、[初识高德API（web服务）]https://lbs.amap.com/api/webservice/guide/api/georegeo\n",
    "> * 2、\n",
    "## 本节知识点\n",
    "> * 地理编码/逆地理编码\n",
    "> * 路及规划\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 准备工作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    " import requests,json\n",
    " import pandas as pd \n",
    "yan_key = \"ef5367355e3cb0820fff00cb4548cf5d\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 地理编码 /逆地理编码"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "> * A.结构化地址的定义： 首先，地址肯定是一串字符，内含国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦等建筑物名称。按照由大区域名称到小区域名称组合在一起的字符。一个有效的地址应该是独一无二的。注意：针对大陆、港、澳地区的地理编码转换时可以将国家信息选择性的忽略，但省、市、城镇等级别的地址构成是不能忽略的。暂时不支持返回台湾省的详细地址信息。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 地理编码 A-1\n",
    "> * B.url:https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "\n",
    "> * C.关于request参数:\n",
    "\n",
    ">>* 必填:key address\n",
    "\n",
    ">* D.requests.get()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "address =\"广东省广州市中山大学南方学院\"\n",
    "url_geo = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "params_geo= {\n",
    "    \"key\":yan_key,\n",
    "    \"address\":address\n",
    "}\n",
    "response = requests.get(url=url_geo,params=params_geo)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.679287,23.632575'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "中大南方_location=response.json()['geocodes'][0]['location']\n",
    "中大南方_location"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  逆地理编码 A-2\n",
    "> * B.url:https://restapi.amap.com/v3/geocode/regeo?parameters\n",
    "\n",
    "> * C.关于request参数:\n",
    "\n",
    ">> * 必填：key,location<经纬度坐标>\n",
    ">> * 选填：extensions(返回详细周边信息)\n",
    "\n",
    "> * D.requests.get()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "url_regeo = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "params_regeo={\n",
    "    \"key\":yan_key,\n",
    "    \"location\":中大南方_location,\n",
    "    \"extensions\":\"all\"\n",
    "}\n",
    "r = requests.get(url_regeo,params_regeo)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "#请取出所有的道路信息 用传统的编程思维"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['博学路', '中山路', 'S29从莞深高速']"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list_ = []\n",
    "for i in r.json()['regeocode']['roads']:\n",
    "    list_.append(i['name'])\n",
    "list_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'regeocode': {'roads': [{'id': '020F49F0050461203',\n",
       "    'location': '113.68,23.634',\n",
       "    'direction': '南',\n",
       "    'name': '博学路',\n",
       "    'distance': '156.951'},\n",
       "   {'id': '020F49F0050462451',\n",
       "    'location': '113.677,23.6347',\n",
       "    'direction': '东南',\n",
       "    'name': '中山路',\n",
       "    'distance': '343.951'},\n",
       "   {'id': '020F49F006047765',\n",
       "    'location': '113.682,23.6394',\n",
       "    'direction': '南',\n",
       "    'name': 'S29从莞深高速',\n",
       "    'distance': '807.947'}],\n",
       "  'roadinters': [{'second_name': '中山路',\n",
       "    'first_id': '020F49F0050461203',\n",
       "    'second_id': '020F49F0050462451',\n",
       "    'location': '113.676794,23.634661',\n",
       "    'distance': '343.951',\n",
       "    'first_name': '博学路',\n",
       "    'direction': '东南'}],\n",
       "  'formatted_address': '广东省广州市从化区温泉镇中山大学南方学院',\n",
       "  'addressComponent': {'city': '广州市',\n",
       "   'province': '广东省',\n",
       "   'adcode': '440117',\n",
       "   'district': '从化区',\n",
       "   'towncode': '440117103000',\n",
       "   'streetNumber': {'number': '7号',\n",
       "    'location': '113.678600,23.633329',\n",
       "    'direction': '西北',\n",
       "    'distance': '109.203',\n",
       "    'street': '博学路'},\n",
       "   'country': '中国',\n",
       "   'township': '温泉镇',\n",
       "   'businessAreas': [[]],\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'citycode': '020'},\n",
       "  'aois': [{'area': '536585.849985',\n",
       "    'type': '141201',\n",
       "    'id': 'B00140MR9A',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'adcode': '440117',\n",
       "    'name': '中山大学南方学院',\n",
       "    'distance': '0'}],\n",
       "  'pois': [{'id': 'B00140MR9A',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.450402',\n",
       "    'name': '中山大学南方学院',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'distance': '2.69979',\n",
       "    'tel': '020-61787331',\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFF2VMJ4',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道886号中山大学南方学院内',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院-综合楼',\n",
       "    'location': '113.680117,23.631544',\n",
       "    'distance': '142.466',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFFTC9PH',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.193172',\n",
       "    'name': '中山大学南方学院教学楼10号',\n",
       "    'location': '113.680125,23.633492',\n",
       "    'distance': '132.988',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TQKX',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼6号',\n",
       "    'location': '113.678424,23.633710',\n",
       "    'distance': '153.818',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B00141TQGR',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼7号',\n",
       "    'location': '113.678600,23.633330',\n",
       "    'distance': '109.298',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B00141WQCO',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.14954',\n",
       "    'name': '中山大学南方学院教学楼8号',\n",
       "    'location': '113.680399,23.634329',\n",
       "    'distance': '225.543',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFG9IORM',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号中山大学南方学院内',\n",
       "    'poiweight': '0.287887',\n",
       "    'name': '中山大学南方学院-图书馆',\n",
       "    'location': '113.679177,23.632762',\n",
       "    'distance': '23.6163',\n",
       "    'tel': '020-61787368;020-61787371',\n",
       "    'type': '科教文化服务;图书馆;图书馆'},\n",
       "   {'id': 'B0FFKP9EQJ',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院4号实验楼',\n",
       "    'location': '113.679963,23.632652',\n",
       "    'distance': '69.4077',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJKIA10',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号中山大学南方学院',\n",
       "    'poiweight': '0.191691',\n",
       "    'name': '中山大学南方学院-第11教学楼',\n",
       "    'location': '113.680037,23.633173',\n",
       "    'distance': '101.294',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TRVH',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路21',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼2号',\n",
       "    'location': '113.677060,23.631346',\n",
       "    'distance': '264.846',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKERBQZ',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7号附近',\n",
       "    'poiweight': '0.289141',\n",
       "    'name': '中山大学南方学院惟贤门',\n",
       "    'location': '113.678437,23.633721',\n",
       "    'distance': '154.082',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFKP81F4',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '政商研究院教学楼9号',\n",
       "    'location': '113.679949,23.633919',\n",
       "    'distance': '163.951',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP9ET5',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院1号实验楼',\n",
       "    'location': '113.678215,23.631370',\n",
       "    'distance': '172.86',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TR76',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路29',\n",
       "    'poiweight': '0.052819',\n",
       "    'name': '中山大学南方学院教学楼4号',\n",
       "    'location': '113.677460,23.630490',\n",
       "    'distance': '297.315',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP7Q5N',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院2号实验楼',\n",
       "    'location': '113.678211,23.630956',\n",
       "    'distance': '210.76',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00140TWHT',\n",
       "    'direction': '南',\n",
       "    'businessarea': [],\n",
       "    'address': '笃行路2号',\n",
       "    'poiweight': '0.157653',\n",
       "    'name': '教工住宅1号',\n",
       "    'location': '113.678490,23.630432',\n",
       "    'distance': '251.758',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0G3ARGF5Y',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.286321',\n",
       "    'name': '中山大学南方学院教学楼1号',\n",
       "    'location': '113.677077,23.631783',\n",
       "    'distance': '241.753',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFLBEOND',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.190963',\n",
       "    'name': '聚贤楼10号',\n",
       "    'location': '113.681253,23.631036',\n",
       "    'distance': '263.444',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFKP81F0',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路19号附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼1号(文学与传媒学院)',\n",
       "    'location': '113.676866,23.631736',\n",
       "    'distance': '263.674',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP838K',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路25',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼3号(外国语学院)',\n",
       "    'location': '113.677247,23.630947',\n",
       "    'distance': '275.62',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJLW0O9',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路4附近',\n",
       "    'poiweight': '0.191645',\n",
       "    'name': '中山大学南方学院西区饭堂',\n",
       "    'location': '113.676210,23.632177',\n",
       "    'distance': '316.572',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKPXMCN',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路',\n",
       "    'poiweight': '0.191739',\n",
       "    'name': '中山大学南方学院音乐系',\n",
       "    'location': '113.678792,23.635389',\n",
       "    'distance': '316.942',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJBZLYT',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路与博学路交叉口东南50米',\n",
       "    'poiweight': '0.297382',\n",
       "    'name': '铜像广场',\n",
       "    'location': '113.676921,23.634555',\n",
       "    'distance': '326.444',\n",
       "    'tel': [],\n",
       "    'type': '风景名胜;风景名胜;风景名胜'},\n",
       "   {'id': 'B0FFG8CSEK',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.185371',\n",
       "    'name': 'L5员工宿舍',\n",
       "    'location': '113.682583,23.631487',\n",
       "    'distance': '356.923',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFKPXO2S',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.188247',\n",
       "    'name': '中山大学南方学院医务室',\n",
       "    'location': '113.679394,23.635924',\n",
       "    'distance': '372.556',\n",
       "    'tel': [],\n",
       "    'type': '医疗保健服务;医疗保健服务场所;医疗保健服务场所'},\n",
       "   {'id': 'B0FFH6K3U9',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇温泉大道882号中大南方H7栋1-5层',\n",
       "    'poiweight': '0.254885',\n",
       "    'name': '广州中大南方招待所',\n",
       "    'location': '113.676330,23.631332',\n",
       "    'distance': '331.438',\n",
       "    'tel': '020-61787222',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0FFHHLMF8',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山大学南方学院明辩路2号第三饭堂',\n",
       "    'poiweight': '0.178935',\n",
       "    'name': '茗语轩餐厅',\n",
       "    'location': '113.681901,23.634495',\n",
       "    'distance': '341.332',\n",
       "    'tel': '13929501395;13533390928',\n",
       "    'type': '餐饮服务;中餐厅;中餐厅'},\n",
       "   {'id': 'B0FFLJV996',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.286264',\n",
       "    'name': '保利桃花源66BLOCK',\n",
       "    'location': '113.682954,23.631008',\n",
       "    'distance': '412.208',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0FFKPXY26',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速公路',\n",
       "    'poiweight': '0.21826',\n",
       "    'name': '中山大学南方学院聚贤楼5号',\n",
       "    'location': '113.680265,23.636313',\n",
       "    'distance': '427.447',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;商务住宅相关;商务住宅相关'},\n",
       "   {'id': 'B0FFGXGN3K',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '中山大学南方学院',\n",
       "    'poiweight': '0.188657',\n",
       "    'name': '中山大学南方学院宿舍H25',\n",
       "    'location': '113.683474,23.632020',\n",
       "    'distance': '430.984',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'}]},\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000'}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>status</th>\n",
       "      <th>info</th>\n",
       "      <th>infocode</th>\n",
       "      <th>regeocode.roads</th>\n",
       "      <th>regeocode.roadinters</th>\n",
       "      <th>regeocode.formatted_address</th>\n",
       "      <th>regeocode.addressComponent.city</th>\n",
       "      <th>regeocode.addressComponent.province</th>\n",
       "      <th>regeocode.addressComponent.adcode</th>\n",
       "      <th>regeocode.addressComponent.district</th>\n",
       "      <th>...</th>\n",
       "      <th>regeocode.addressComponent.country</th>\n",
       "      <th>regeocode.addressComponent.township</th>\n",
       "      <th>regeocode.addressComponent.businessAreas</th>\n",
       "      <th>regeocode.addressComponent.building.name</th>\n",
       "      <th>regeocode.addressComponent.building.type</th>\n",
       "      <th>regeocode.addressComponent.neighborhood.name</th>\n",
       "      <th>regeocode.addressComponent.neighborhood.type</th>\n",
       "      <th>regeocode.addressComponent.citycode</th>\n",
       "      <th>regeocode.aois</th>\n",
       "      <th>regeocode.pois</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>OK</td>\n",
       "      <td>10000</td>\n",
       "      <td>[{'id': '020F49F0050461203', 'location': '113....</td>\n",
       "      <td>[{'second_name': '中山路', 'first_id': '020F49F00...</td>\n",
       "      <td>广东省广州市从化区温泉镇中山大学南方学院</td>\n",
       "      <td>广州市</td>\n",
       "      <td>广东省</td>\n",
       "      <td>440117</td>\n",
       "      <td>从化区</td>\n",
       "      <td>...</td>\n",
       "      <td>中国</td>\n",
       "      <td>温泉镇</td>\n",
       "      <td>[[]]</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>020</td>\n",
       "      <td>[{'area': '536585.849985', 'type': '141201', '...</td>\n",
       "      <td>[{'id': 'B00140MR9A', 'direction': '西', 'busin...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "  status info infocode                                    regeocode.roads  \\\n",
       "0      1   OK    10000  [{'id': '020F49F0050461203', 'location': '113....   \n",
       "\n",
       "                                regeocode.roadinters  \\\n",
       "0  [{'second_name': '中山路', 'first_id': '020F49F00...   \n",
       "\n",
       "  regeocode.formatted_address regeocode.addressComponent.city  \\\n",
       "0        广东省广州市从化区温泉镇中山大学南方学院                             广州市   \n",
       "\n",
       "  regeocode.addressComponent.province regeocode.addressComponent.adcode  \\\n",
       "0                                 广东省                            440117   \n",
       "\n",
       "  regeocode.addressComponent.district  ... regeocode.addressComponent.country  \\\n",
       "0                                 从化区  ...                                 中国   \n",
       "\n",
       "  regeocode.addressComponent.township  \\\n",
       "0                                 温泉镇   \n",
       "\n",
       "  regeocode.addressComponent.businessAreas  \\\n",
       "0                                     [[]]   \n",
       "\n",
       "  regeocode.addressComponent.building.name  \\\n",
       "0                                       []   \n",
       "\n",
       "  regeocode.addressComponent.building.type  \\\n",
       "0                                       []   \n",
       "\n",
       "  regeocode.addressComponent.neighborhood.name  \\\n",
       "0                                           []   \n",
       "\n",
       "  regeocode.addressComponent.neighborhood.type  \\\n",
       "0                                           []   \n",
       "\n",
       "  regeocode.addressComponent.citycode  \\\n",
       "0                                 020   \n",
       "\n",
       "                                      regeocode.aois  \\\n",
       "0  [{'area': '536585.849985', 'type': '141201', '...   \n",
       "\n",
       "                                      regeocode.pois  \n",
       "0  [{'id': 'B00140MR9A', 'direction': '西', 'busin...  \n",
       "\n",
       "[1 rows x 26 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>location</th>\n",
       "      <th>direction</th>\n",
       "      <th>name</th>\n",
       "      <th>distance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>020F49F0050461203</td>\n",
       "      <td>113.68,23.634</td>\n",
       "      <td>南</td>\n",
       "      <td>博学路</td>\n",
       "      <td>156.951</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>020F49F0050462451</td>\n",
       "      <td>113.677,23.6347</td>\n",
       "      <td>东南</td>\n",
       "      <td>中山路</td>\n",
       "      <td>343.951</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>020F49F006047765</td>\n",
       "      <td>113.682,23.6394</td>\n",
       "      <td>南</td>\n",
       "      <td>S29从莞深高速</td>\n",
       "      <td>807.947</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                  id         location direction      name distance\n",
       "0  020F49F0050461203    113.68,23.634         南       博学路  156.951\n",
       "1  020F49F0050462451  113.677,23.6347        东南       中山路  343.951\n",
       "2   020F49F006047765  113.682,23.6394         南  S29从莞深高速  807.947"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['regeocode']['roads'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>direction</th>\n",
       "      <th>businessarea</th>\n",
       "      <th>address</th>\n",
       "      <th>poiweight</th>\n",
       "      <th>name</th>\n",
       "      <th>location</th>\n",
       "      <th>distance</th>\n",
       "      <th>tel</th>\n",
       "      <th>type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B00140MR9A</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882号</td>\n",
       "      <td>0.450402</td>\n",
       "      <td>中山大学南方学院</td>\n",
       "      <td>113.679262,23.632583</td>\n",
       "      <td>2.69979</td>\n",
       "      <td>020-61787331</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B0FFF2VMJ4</td>\n",
       "      <td>东南</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道886号中山大学南方学院内</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院-综合楼</td>\n",
       "      <td>113.680117,23.631544</td>\n",
       "      <td>142.466</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B0FFFTC9PH</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速(中山大学南方学院)</td>\n",
       "      <td>0.193172</td>\n",
       "      <td>中山大学南方学院教学楼10号</td>\n",
       "      <td>113.680125,23.633492</td>\n",
       "      <td>132.988</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B00141TQKX</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院教学楼6号</td>\n",
       "      <td>113.678424,23.633710</td>\n",
       "      <td>153.818</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B00141TQGR</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路7</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院教学楼7号</td>\n",
       "      <td>113.678600,23.633330</td>\n",
       "      <td>109.298</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>B00141WQCO</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.14954</td>\n",
       "      <td>中山大学南方学院教学楼8号</td>\n",
       "      <td>113.680399,23.634329</td>\n",
       "      <td>225.543</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>B0FFG9IORM</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882号中山大学南方学院内</td>\n",
       "      <td>0.287887</td>\n",
       "      <td>中山大学南方学院-图书馆</td>\n",
       "      <td>113.679177,23.632762</td>\n",
       "      <td>23.6163</td>\n",
       "      <td>020-61787368;020-61787371</td>\n",
       "      <td>科教文化服务;图书馆;图书馆</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>B0FFKP9EQJ</td>\n",
       "      <td>东</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>中山大学南方学院4号实验楼</td>\n",
       "      <td>113.679963,23.632652</td>\n",
       "      <td>69.4077</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>B0FFJKIA10</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉大道882号中山大学南方学院</td>\n",
       "      <td>0.191691</td>\n",
       "      <td>中山大学南方学院-第11教学楼</td>\n",
       "      <td>113.680037,23.633173</td>\n",
       "      <td>101.294</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>B00141TRVH</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路21</td>\n",
       "      <td>0.148531</td>\n",
       "      <td>中山大学南方学院教学楼2号</td>\n",
       "      <td>113.677060,23.631346</td>\n",
       "      <td>264.846</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>B0FFKERBQZ</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路7号附近</td>\n",
       "      <td>0.289141</td>\n",
       "      <td>中山大学南方学院惟贤门</td>\n",
       "      <td>113.678437,23.633721</td>\n",
       "      <td>154.082</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>B0FFKP81F4</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山路</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>政商研究院教学楼9号</td>\n",
       "      <td>113.679949,23.633919</td>\n",
       "      <td>163.951</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>B0FFKP9ET5</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>中山大学南方学院1号实验楼</td>\n",
       "      <td>113.678215,23.631370</td>\n",
       "      <td>172.86</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>B00141TR76</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路29</td>\n",
       "      <td>0.052819</td>\n",
       "      <td>中山大学南方学院教学楼4号</td>\n",
       "      <td>113.677460,23.630490</td>\n",
       "      <td>297.315</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>B0FFKP7Q5N</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>中山大学南方学院2号实验楼</td>\n",
       "      <td>113.678211,23.630956</td>\n",
       "      <td>210.76</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>B00140TWHT</td>\n",
       "      <td>南</td>\n",
       "      <td>[]</td>\n",
       "      <td>笃行路2号</td>\n",
       "      <td>0.157653</td>\n",
       "      <td>教工住宅1号</td>\n",
       "      <td>113.678490,23.630432</td>\n",
       "      <td>251.758</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;住宅小区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>B0G3ARGF5Y</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.286321</td>\n",
       "      <td>中山大学南方学院教学楼1号</td>\n",
       "      <td>113.677077,23.631783</td>\n",
       "      <td>241.753</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>B0FFLBEOND</td>\n",
       "      <td>东南</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速(中山大学南方学院)</td>\n",
       "      <td>0.190963</td>\n",
       "      <td>聚贤楼10号</td>\n",
       "      <td>113.681253,23.631036</td>\n",
       "      <td>263.444</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>B0FFKP81F0</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路19号附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>教学楼1号(文学与传媒学院)</td>\n",
       "      <td>113.676866,23.631736</td>\n",
       "      <td>263.674</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>B0FFKP838K</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路25</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>教学楼3号(外国语学院)</td>\n",
       "      <td>113.677247,23.630947</td>\n",
       "      <td>275.62</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>B0FFJLW0O9</td>\n",
       "      <td>西</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路4附近</td>\n",
       "      <td>0.191645</td>\n",
       "      <td>中山大学南方学院西区饭堂</td>\n",
       "      <td>113.676210,23.632177</td>\n",
       "      <td>316.572</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>B0FFKPXMCN</td>\n",
       "      <td>北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山路</td>\n",
       "      <td>0.191739</td>\n",
       "      <td>中山大学南方学院音乐系</td>\n",
       "      <td>113.678792,23.635389</td>\n",
       "      <td>316.942</td>\n",
       "      <td>[]</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>B0FFJBZLYT</td>\n",
       "      <td>西北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山路与博学路交叉口东南50米</td>\n",
       "      <td>0.297382</td>\n",
       "      <td>铜像广场</td>\n",
       "      <td>113.676921,23.634555</td>\n",
       "      <td>326.444</td>\n",
       "      <td>[]</td>\n",
       "      <td>风景名胜;风景名胜;风景名胜</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>B0FFG8CSEK</td>\n",
       "      <td>东</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速(中山大学南方学院)</td>\n",
       "      <td>0.185371</td>\n",
       "      <td>L5员工宿舍</td>\n",
       "      <td>113.682583,23.631487</td>\n",
       "      <td>356.923</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>B0FFKPXO2S</td>\n",
       "      <td>北</td>\n",
       "      <td>[]</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.188247</td>\n",
       "      <td>中山大学南方学院医务室</td>\n",
       "      <td>113.679394,23.635924</td>\n",
       "      <td>372.556</td>\n",
       "      <td>[]</td>\n",
       "      <td>医疗保健服务;医疗保健服务场所;医疗保健服务场所</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>B0FFH6K3U9</td>\n",
       "      <td>西南</td>\n",
       "      <td>[]</td>\n",
       "      <td>温泉镇温泉大道882号中大南方H7栋1-5层</td>\n",
       "      <td>0.254885</td>\n",
       "      <td>广州中大南方招待所</td>\n",
       "      <td>113.676330,23.631332</td>\n",
       "      <td>331.438</td>\n",
       "      <td>020-61787222</td>\n",
       "      <td>住宿服务;住宿服务相关;住宿服务相关</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>B0FFHHLMF8</td>\n",
       "      <td>东北</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山大学南方学院明辩路2号第三饭堂</td>\n",
       "      <td>0.178935</td>\n",
       "      <td>茗语轩餐厅</td>\n",
       "      <td>113.681901,23.634495</td>\n",
       "      <td>341.332</td>\n",
       "      <td>13929501395;13533390928</td>\n",
       "      <td>餐饮服务;中餐厅;中餐厅</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>B0FFLJV996</td>\n",
       "      <td>东南</td>\n",
       "      <td>[]</td>\n",
       "      <td>[]</td>\n",
       "      <td>0.286264</td>\n",
       "      <td>保利桃花源66BLOCK</td>\n",
       "      <td>113.682954,23.631008</td>\n",
       "      <td>412.208</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;住宅小区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>B0FFKPXY26</td>\n",
       "      <td>北</td>\n",
       "      <td>[]</td>\n",
       "      <td>从莞深高速公路</td>\n",
       "      <td>0.21826</td>\n",
       "      <td>中山大学南方学院聚贤楼5号</td>\n",
       "      <td>113.680265,23.636313</td>\n",
       "      <td>427.447</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;商务住宅相关;商务住宅相关</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>B0FFGXGN3K</td>\n",
       "      <td>东</td>\n",
       "      <td>[]</td>\n",
       "      <td>中山大学南方学院</td>\n",
       "      <td>0.188657</td>\n",
       "      <td>中山大学南方学院宿舍H25</td>\n",
       "      <td>113.683474,23.632020</td>\n",
       "      <td>430.984</td>\n",
       "      <td>[]</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            id direction businessarea                 address poiweight  \\\n",
       "0   B00140MR9A         西           []                温泉大道882号  0.450402   \n",
       "1   B0FFF2VMJ4        东南           []       温泉大道886号中山大学南方学院内  0.148531   \n",
       "2   B0FFFTC9PH        东北           []         从莞深高速(中山大学南方学院)  0.193172   \n",
       "3   B00141TQKX        西北           []                 温泉大道882  0.148531   \n",
       "4   B00141TQGR        西北           []                    博学路7  0.148531   \n",
       "5   B00141WQCO        东北           []                     博学路   0.14954   \n",
       "6   B0FFG9IORM        西北           []       温泉大道882号中山大学南方学院内  0.287887   \n",
       "7   B0FFKP9EQJ         东           []                   博学路附近  0.191742   \n",
       "8   B0FFJKIA10        东北           []        温泉大道882号中山大学南方学院  0.191691   \n",
       "9   B00141TRVH        西南           []                   博学路21  0.148531   \n",
       "10  B0FFKERBQZ        西北           []                 博学路7号附近  0.289141   \n",
       "11  B0FFKP81F4        东北           []                     中山路  0.191742   \n",
       "12  B0FFKP9ET5        西南           []                   博学路附近  0.191742   \n",
       "13  B00141TR76        西南           []                   博学路29  0.052819   \n",
       "14  B0FFKP7Q5N        西南           []                     博学路  0.191742   \n",
       "15  B00140TWHT         南           []                   笃行路2号  0.157653   \n",
       "16  B0G3ARGF5Y         西           []                      []  0.286321   \n",
       "17  B0FFLBEOND        东南           []         从莞深高速(中山大学南方学院)  0.190963   \n",
       "18  B0FFKP81F0         西           []                博学路19号附近  0.191742   \n",
       "19  B0FFKP838K        西南           []                   博学路25  0.191742   \n",
       "20  B0FFJLW0O9         西           []                  博学路4附近  0.191645   \n",
       "21  B0FFKPXMCN         北           []                     中山路  0.191739   \n",
       "22  B0FFJBZLYT        西北           []         中山路与博学路交叉口东南50米  0.297382   \n",
       "23  B0FFG8CSEK         东           []         从莞深高速(中山大学南方学院)  0.185371   \n",
       "24  B0FFKPXO2S         北           []                   博学路附近  0.188247   \n",
       "25  B0FFH6K3U9        西南           []  温泉镇温泉大道882号中大南方H7栋1-5层  0.254885   \n",
       "26  B0FFHHLMF8        东北           []       中山大学南方学院明辩路2号第三饭堂  0.178935   \n",
       "27  B0FFLJV996        东南           []                      []  0.286264   \n",
       "28  B0FFKPXY26         北           []                 从莞深高速公路   0.21826   \n",
       "29  B0FFGXGN3K         东           []                中山大学南方学院  0.188657   \n",
       "\n",
       "               name              location distance                        tel  \\\n",
       "0          中山大学南方学院  113.679262,23.632583  2.69979               020-61787331   \n",
       "1      中山大学南方学院-综合楼  113.680117,23.631544  142.466                         []   \n",
       "2    中山大学南方学院教学楼10号  113.680125,23.633492  132.988                         []   \n",
       "3     中山大学南方学院教学楼6号  113.678424,23.633710  153.818                         []   \n",
       "4     中山大学南方学院教学楼7号  113.678600,23.633330  109.298                         []   \n",
       "5     中山大学南方学院教学楼8号  113.680399,23.634329  225.543                         []   \n",
       "6      中山大学南方学院-图书馆  113.679177,23.632762  23.6163  020-61787368;020-61787371   \n",
       "7     中山大学南方学院4号实验楼  113.679963,23.632652  69.4077                         []   \n",
       "8   中山大学南方学院-第11教学楼  113.680037,23.633173  101.294                         []   \n",
       "9     中山大学南方学院教学楼2号  113.677060,23.631346  264.846                         []   \n",
       "10      中山大学南方学院惟贤门  113.678437,23.633721  154.082                         []   \n",
       "11       政商研究院教学楼9号  113.679949,23.633919  163.951                         []   \n",
       "12    中山大学南方学院1号实验楼  113.678215,23.631370   172.86                         []   \n",
       "13    中山大学南方学院教学楼4号  113.677460,23.630490  297.315                         []   \n",
       "14    中山大学南方学院2号实验楼  113.678211,23.630956   210.76                         []   \n",
       "15           教工住宅1号  113.678490,23.630432  251.758                         []   \n",
       "16    中山大学南方学院教学楼1号  113.677077,23.631783  241.753                         []   \n",
       "17           聚贤楼10号  113.681253,23.631036  263.444                         []   \n",
       "18   教学楼1号(文学与传媒学院)  113.676866,23.631736  263.674                         []   \n",
       "19     教学楼3号(外国语学院)  113.677247,23.630947   275.62                         []   \n",
       "20     中山大学南方学院西区饭堂  113.676210,23.632177  316.572                         []   \n",
       "21      中山大学南方学院音乐系  113.678792,23.635389  316.942                         []   \n",
       "22             铜像广场  113.676921,23.634555  326.444                         []   \n",
       "23           L5员工宿舍  113.682583,23.631487  356.923                         []   \n",
       "24      中山大学南方学院医务室  113.679394,23.635924  372.556                         []   \n",
       "25        广州中大南方招待所  113.676330,23.631332  331.438               020-61787222   \n",
       "26            茗语轩餐厅  113.681901,23.634495  341.332    13929501395;13533390928   \n",
       "27     保利桃花源66BLOCK  113.682954,23.631008  412.208                         []   \n",
       "28    中山大学南方学院聚贤楼5号  113.680265,23.636313  427.447                         []   \n",
       "29    中山大学南方学院宿舍H25  113.683474,23.632020  430.984                         []   \n",
       "\n",
       "                        type  \n",
       "0             科教文化服务;学校;高等院校  \n",
       "1               科教文化服务;学校;学校  \n",
       "2       科教文化服务;科教文化场所;科教文化场所  \n",
       "3               科教文化服务;学校;学校  \n",
       "4             科教文化服务;学校;高等院校  \n",
       "5       科教文化服务;科教文化场所;科教文化场所  \n",
       "6             科教文化服务;图书馆;图书馆  \n",
       "7       科教文化服务;科教文化场所;科教文化场所  \n",
       "8       科教文化服务;科教文化场所;科教文化场所  \n",
       "9       科教文化服务;科教文化场所;科教文化场所  \n",
       "10            科教文化服务;学校;高等院校  \n",
       "11      科教文化服务;科教文化场所;科教文化场所  \n",
       "12      科教文化服务;科教文化场所;科教文化场所  \n",
       "13      科教文化服务;科教文化场所;科教文化场所  \n",
       "14      科教文化服务;科教文化场所;科教文化场所  \n",
       "15             商务住宅;住宅区;住宅小区  \n",
       "16            科教文化服务;学校;高等院校  \n",
       "17               商务住宅;住宅区;宿舍  \n",
       "18      科教文化服务;科教文化场所;科教文化场所  \n",
       "19      科教文化服务;科教文化场所;科教文化场所  \n",
       "20      科教文化服务;科教文化场所;科教文化场所  \n",
       "21      科教文化服务;科教文化场所;科教文化场所  \n",
       "22            风景名胜;风景名胜;风景名胜  \n",
       "23               商务住宅;住宅区;宿舍  \n",
       "24  医疗保健服务;医疗保健服务场所;医疗保健服务场所  \n",
       "25        住宿服务;住宿服务相关;住宿服务相关  \n",
       "26              餐饮服务;中餐厅;中餐厅  \n",
       "27             商务住宅;住宅区;住宅小区  \n",
       "28        商务住宅;商务住宅相关;商务住宅相关  \n",
       "29               商务住宅;住宅区;宿舍  "
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['regeocode']['pois'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0            中山大学南方学院\n",
       "1        中山大学南方学院-综合楼\n",
       "2      中山大学南方学院教学楼10号\n",
       "3       中山大学南方学院教学楼6号\n",
       "4       中山大学南方学院教学楼7号\n",
       "5       中山大学南方学院教学楼8号\n",
       "6        中山大学南方学院-图书馆\n",
       "7       中山大学南方学院4号实验楼\n",
       "8     中山大学南方学院-第11教学楼\n",
       "9       中山大学南方学院教学楼2号\n",
       "10        中山大学南方学院惟贤门\n",
       "11         政商研究院教学楼9号\n",
       "12      中山大学南方学院1号实验楼\n",
       "13      中山大学南方学院教学楼4号\n",
       "14      中山大学南方学院2号实验楼\n",
       "15             教工住宅1号\n",
       "16      中山大学南方学院教学楼1号\n",
       "17             聚贤楼10号\n",
       "18     教学楼1号(文学与传媒学院)\n",
       "19       教学楼3号(外国语学院)\n",
       "20       中山大学南方学院西区饭堂\n",
       "21        中山大学南方学院音乐系\n",
       "22               铜像广场\n",
       "23             L5员工宿舍\n",
       "24        中山大学南方学院医务室\n",
       "25          广州中大南方招待所\n",
       "26              茗语轩餐厅\n",
       "27       保利桃花源66BLOCK\n",
       "28      中山大学南方学院聚贤楼5号\n",
       "29      中山大学南方学院宿舍H25\n",
       "Name: name, dtype: object"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['regeocode']['pois'])['name']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  路径规划"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 1.步行\n",
    "* 2.公交车\n",
    "* 3.驾车"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 步行"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> * 1.url：https://restapi.amap.com/v3/direction/walking?parameters\n",
    "\n",
    "> * 2.requests.get()\n",
    "\n",
    "> * 3.参数\n",
    ">> * 必填：key，origin（出发点,经纬度），destination（目的地，经纬度）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "#函数 地理编码\n",
    "def geocode(key,address):\n",
    "    \"\"\"获取高德API的地理编码信息\n",
    "    key是高德web服务中API注册的密钥\n",
    "    address是结构化参考地址，参考:\"\"\"\n",
    "    url=\"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "    params= {\n",
    "    \"key\":key,\n",
    "    \"address\":address\n",
    "    }\n",
    "    response = requests.get(url,params=params)\n",
    "    #返回值\n",
    "    return response.json()['geocodes'][0]['location']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in module time:\n",
      "\n",
      "NAME\n",
      "    time - This module provides various functions to manipulate time values.\n",
      "\n",
      "DESCRIPTION\n",
      "    There are two standard representations of time.  One is the number\n",
      "    of seconds since the Epoch, in UTC (a.k.a. GMT).  It may be an integer\n",
      "    or a floating point number (to represent fractions of seconds).\n",
      "    The Epoch is system-defined; on Unix, it is generally January 1st, 1970.\n",
      "    The actual value can be retrieved by calling gmtime(0).\n",
      "    \n",
      "    The other representation is a tuple of 9 integers giving local time.\n",
      "    The tuple items are:\n",
      "      year (including century, e.g. 1998)\n",
      "      month (1-12)\n",
      "      day (1-31)\n",
      "      hours (0-23)\n",
      "      minutes (0-59)\n",
      "      seconds (0-59)\n",
      "      weekday (0-6, Monday is 0)\n",
      "      Julian day (day in the year, 1-366)\n",
      "      DST (Daylight Savings Time) flag (-1, 0 or 1)\n",
      "    If the DST flag is 0, the time is given in the regular time zone;\n",
      "    if it is 1, the time is given in the DST time zone;\n",
      "    if it is -1, mktime() should guess based on the date and time.\n",
      "\n",
      "CLASSES\n",
      "    builtins.tuple(builtins.object)\n",
      "        struct_time\n",
      "    \n",
      "    class struct_time(builtins.tuple)\n",
      "     |  struct_time(iterable=(), /)\n",
      "     |  \n",
      "     |  The time value as returned by gmtime(), localtime(), and strptime(), and\n",
      "     |  accepted by asctime(), mktime() and strftime().  May be considered as a\n",
      "     |  sequence of 9 integers.\n",
      "     |  \n",
      "     |  Note that several fields' values are not the same as those defined by\n",
      "     |  the C language standard for struct tm.  For example, the value of the\n",
      "     |  field tm_year is the actual year, not year - 1900.  See individual\n",
      "     |  fields' descriptions for details.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      struct_time\n",
      "     |      builtins.tuple\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  tm_gmtoff\n",
      "     |      offset from UTC in seconds\n",
      "     |  \n",
      "     |  tm_hour\n",
      "     |      hours, range [0, 23]\n",
      "     |  \n",
      "     |  tm_isdst\n",
      "     |      1 if summer time is in effect, 0 if not, and -1 if unknown\n",
      "     |  \n",
      "     |  tm_mday\n",
      "     |      day of month, range [1, 31]\n",
      "     |  \n",
      "     |  tm_min\n",
      "     |      minutes, range [0, 59]\n",
      "     |  \n",
      "     |  tm_mon\n",
      "     |      month of year, range [1, 12]\n",
      "     |  \n",
      "     |  tm_sec\n",
      "     |      seconds, range [0, 61])\n",
      "     |  \n",
      "     |  tm_wday\n",
      "     |      day of week, range [0, 6], Monday is 0\n",
      "     |  \n",
      "     |  tm_yday\n",
      "     |      day of year, range [1, 366]\n",
      "     |  \n",
      "     |  tm_year\n",
      "     |      year, for example, 1993\n",
      "     |  \n",
      "     |  tm_zone\n",
      "     |      abbreviation of timezone name\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  n_fields = 11\n",
      "     |  \n",
      "     |  n_sequence_fields = 9\n",
      "     |  \n",
      "     |  n_unnamed_fields = 0\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.tuple:\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __contains__(self, key, /)\n",
      "     |      Return key in self.\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __getitem__(self, key, /)\n",
      "     |      Return self[key].\n",
      "     |  \n",
      "     |  __getnewargs__(self, /)\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __iter__(self, /)\n",
      "     |      Implement iter(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __len__(self, /)\n",
      "     |      Return len(self).\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __mul__(self, value, /)\n",
      "     |      Return self*value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __rmul__(self, value, /)\n",
      "     |      Return value*self.\n",
      "     |  \n",
      "     |  count(self, value, /)\n",
      "     |      Return number of occurrences of value.\n",
      "     |  \n",
      "     |  index(self, value, start=0, stop=9223372036854775807, /)\n",
      "     |      Return first index of value.\n",
      "     |      \n",
      "     |      Raises ValueError if the value is not present.\n",
      "\n",
      "FUNCTIONS\n",
      "    asctime(...)\n",
      "        asctime([tuple]) -> string\n",
      "        \n",
      "        Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.\n",
      "        When the time tuple is not present, current time as returned by localtime()\n",
      "        is used.\n",
      "    \n",
      "    ctime(...)\n",
      "        ctime(seconds) -> string\n",
      "        \n",
      "        Convert a time in seconds since the Epoch to a string in local time.\n",
      "        This is equivalent to asctime(localtime(seconds)). When the time tuple is\n",
      "        not present, current time as returned by localtime() is used.\n",
      "    \n",
      "    get_clock_info(...)\n",
      "        get_clock_info(name: str) -> dict\n",
      "        \n",
      "        Get information of the specified clock.\n",
      "    \n",
      "    gmtime(...)\n",
      "        gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,\n",
      "                               tm_sec, tm_wday, tm_yday, tm_isdst)\n",
      "        \n",
      "        Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.\n",
      "        GMT).  When 'seconds' is not passed in, convert the current time instead.\n",
      "        \n",
      "        If the platform supports the tm_gmtoff and tm_zone, they are available as\n",
      "        attributes only.\n",
      "    \n",
      "    localtime(...)\n",
      "        localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,\n",
      "                                  tm_sec,tm_wday,tm_yday,tm_isdst)\n",
      "        \n",
      "        Convert seconds since the Epoch to a time tuple expressing local time.\n",
      "        When 'seconds' is not passed in, convert the current time instead.\n",
      "    \n",
      "    mktime(...)\n",
      "        mktime(tuple) -> floating point number\n",
      "        \n",
      "        Convert a time tuple in local time to seconds since the Epoch.\n",
      "        Note that mktime(gmtime(0)) will not generally return zero for most\n",
      "        time zones; instead the returned value will either be equal to that\n",
      "        of the timezone or altzone attributes on the time module.\n",
      "    \n",
      "    monotonic(...)\n",
      "        monotonic() -> float\n",
      "        \n",
      "        Monotonic clock, cannot go backward.\n",
      "    \n",
      "    monotonic_ns(...)\n",
      "        monotonic_ns() -> int\n",
      "        \n",
      "        Monotonic clock, cannot go backward, as nanoseconds.\n",
      "    \n",
      "    perf_counter(...)\n",
      "        perf_counter() -> float\n",
      "        \n",
      "        Performance counter for benchmarking.\n",
      "    \n",
      "    perf_counter_ns(...)\n",
      "        perf_counter_ns() -> int\n",
      "        \n",
      "        Performance counter for benchmarking as nanoseconds.\n",
      "    \n",
      "    process_time(...)\n",
      "        process_time() -> float\n",
      "        \n",
      "        Process time for profiling: sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    process_time_ns(...)\n",
      "        process_time() -> int\n",
      "        \n",
      "        Process time for profiling as nanoseconds:\n",
      "        sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    sleep(...)\n",
      "        sleep(seconds)\n",
      "        \n",
      "        Delay execution for a given number of seconds.  The argument may be\n",
      "        a floating point number for subsecond precision.\n",
      "    \n",
      "    strftime(...)\n",
      "        strftime(format[, tuple]) -> string\n",
      "        \n",
      "        Convert a time tuple to a string according to a format specification.\n",
      "        See the library reference manual for formatting codes. When the time tuple\n",
      "        is not present, current time as returned by localtime() is used.\n",
      "        \n",
      "        Commonly used format codes:\n",
      "        \n",
      "        %Y  Year with century as a decimal number.\n",
      "        %m  Month as a decimal number [01,12].\n",
      "        %d  Day of the month as a decimal number [01,31].\n",
      "        %H  Hour (24-hour clock) as a decimal number [00,23].\n",
      "        %M  Minute as a decimal number [00,59].\n",
      "        %S  Second as a decimal number [00,61].\n",
      "        %z  Time zone offset from UTC.\n",
      "        %a  Locale's abbreviated weekday name.\n",
      "        %A  Locale's full weekday name.\n",
      "        %b  Locale's abbreviated month name.\n",
      "        %B  Locale's full month name.\n",
      "        %c  Locale's appropriate date and time representation.\n",
      "        %I  Hour (12-hour clock) as a decimal number [01,12].\n",
      "        %p  Locale's equivalent of either AM or PM.\n",
      "        \n",
      "        Other codes may be available on your platform.  See documentation for\n",
      "        the C library strftime function.\n",
      "    \n",
      "    strptime(...)\n",
      "        strptime(string, format) -> struct_time\n",
      "        \n",
      "        Parse a string to a time tuple according to a format specification.\n",
      "        See the library reference manual for formatting codes (same as\n",
      "        strftime()).\n",
      "        \n",
      "        Commonly used format codes:\n",
      "        \n",
      "        %Y  Year with century as a decimal number.\n",
      "        %m  Month as a decimal number [01,12].\n",
      "        %d  Day of the month as a decimal number [01,31].\n",
      "        %H  Hour (24-hour clock) as a decimal number [00,23].\n",
      "        %M  Minute as a decimal number [00,59].\n",
      "        %S  Second as a decimal number [00,61].\n",
      "        %z  Time zone offset from UTC.\n",
      "        %a  Locale's abbreviated weekday name.\n",
      "        %A  Locale's full weekday name.\n",
      "        %b  Locale's abbreviated month name.\n",
      "        %B  Locale's full month name.\n",
      "        %c  Locale's appropriate date and time representation.\n",
      "        %I  Hour (12-hour clock) as a decimal number [01,12].\n",
      "        %p  Locale's equivalent of either AM or PM.\n",
      "        \n",
      "        Other codes may be available on your platform.  See documentation for\n",
      "        the C library strftime function.\n",
      "    \n",
      "    thread_time(...)\n",
      "        thread_time() -> float\n",
      "        \n",
      "        Thread time for profiling: sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    thread_time_ns(...)\n",
      "        thread_time() -> int\n",
      "        \n",
      "        Thread time for profiling as nanoseconds:\n",
      "        sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    time(...)\n",
      "        time() -> floating point number\n",
      "        \n",
      "        Return the current time in seconds since the Epoch.\n",
      "        Fractions of a second may be present if the system clock provides them.\n",
      "    \n",
      "    time_ns(...)\n",
      "        time_ns() -> int\n",
      "        \n",
      "        Return the current time in nanoseconds since the Epoch.\n",
      "\n",
      "DATA\n",
      "    altzone = -32400\n",
      "    daylight = 0\n",
      "    timezone = -28800\n",
      "    tzname = ('中国标准时间', '中国夏令时')\n",
      "\n",
      "FILE\n",
      "    (built-in)\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(time)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function geocode in module __main__:\n",
      "\n",
      "geocode(key, address)\n",
      "    获取高德API的地理编码信息\n",
      "    key是高德web服务中API注册的密钥\n",
      "    address是结构化参考地址，参考:\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(geocode)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.679287,23.632575'"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "address =\"广东省广州市中山大学南方学院\"\n",
    "address2=\"广东省广州市从化区龙岗镇\"\n",
    "中大南方_location=geocode(yan_key,address)\n",
    "中大南方_location"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.586605,23.548852'"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "龙岗_location=geocode(yan_key,address2)\n",
    "龙岗_location"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'116.308264,39.995304'"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#假如有一个刚会python的，告诉他有一个函数可以用，你只需要提供高德key的结构化地址\n",
    "geocode(\"ef5367355e3cb0820fff00cb4548cf5d\",\"北京市北京大学\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "#函数 地理编码\n",
    "#位置参数 关键字参数（默认参数）\n",
    "def geocode(key,address,city=None)->str:\n",
    "    \"\"\"获取高德API的地理编码信息\n",
    "    key是高德web服务中API注册的密钥\n",
    "    address是结构化参考地址，参考:\"\"\"\n",
    "    url=\"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "    params= {\n",
    "    \"key\":key,\n",
    "    \"address\":address,\n",
    "    \"city\":city\n",
    "    }\n",
    "    response = requests.get(url,params=params)\n",
    "    results=response.json()['geocodes'][0]['location']\n",
    "    #返回值\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.679287,23.632575'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "address =\"广东省广州市中山大学南方学院\"\n",
    "address2=\"广东省广州市从化区龙岗镇\"\n",
    "中大南方_location=geocode(key=yan_key,address=address,city=\"广州\")\n",
    "中大南方_location"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.586605,23.548852'"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "龙岗_location=geocode(yan_key,address2)\n",
    "龙岗_location"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 步行\n",
    "url = \"https://restapi.amap.com/v3/direction/walking?parameters\"\n",
    "params = {\n",
    "    \"key\":yan_key,\n",
    "    \"origin\":中大南方_location,\n",
    "    \"destination\":龙岗_location\n",
    "}\n",
    "r = requests.get(url,params)\n",
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'distance': '16749',\n",
       "  'duration': '13399',\n",
       "  'steps': [{'instruction': '向东步行101米右转',\n",
       "    'orientation': '东',\n",
       "    'road': [],\n",
       "    'distance': '101',\n",
       "    'duration': '81',\n",
       "    'polyline': '113.679592,23.632491;113.680586,23.632522',\n",
       "    'action': '右转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向南步行199米向右前方行走',\n",
       "    'orientation': '南',\n",
       "    'road': [],\n",
       "    'distance': '199',\n",
       "    'duration': '159',\n",
       "    'polyline': '113.680586,23.632522;113.680638,23.63214;113.680668,23.63174;113.680634,23.631541;113.68059,23.631437;113.68059,23.631437;113.680499,23.631241;113.680408,23.631094;113.680208,23.630842',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向西步行159米左转',\n",
       "    'orientation': '西',\n",
       "    'road': [],\n",
       "    'distance': '159',\n",
       "    'duration': '127',\n",
       "    'polyline': '113.680204,23.630838;113.680035,23.630773;113.680035,23.630773;113.679644,23.630638;113.679644,23.630638;113.679362,23.630521;113.679201,23.630473;113.679201,23.630473;113.679032,23.63043;113.679032,23.63043;113.67888,23.630404;113.67888,23.630404;113.678711,23.630365',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向南步行237米左转',\n",
       "    'orientation': '南',\n",
       "    'road': [],\n",
       "    'distance': '237',\n",
       "    'duration': '190',\n",
       "    'polyline': '113.678711,23.63036;113.678711,23.62934;113.678711,23.62934;113.678711,23.629193;113.678689,23.629084;113.678637,23.629023;113.678424,23.628902;113.678368,23.628841;113.678316,23.628724;113.678294,23.628611;113.678294,23.628611;113.678277,23.628372',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向南步行498米向右前方行走',\n",
       "    'orientation': '南',\n",
       "    'road': [],\n",
       "    'distance': '498',\n",
       "    'duration': '398',\n",
       "    'polyline': '113.678273,23.628368;113.678572,23.628338;113.678685,23.628307;113.678685,23.628307;113.678845,23.628234;113.679045,23.628073;113.679158,23.627964;113.679158,23.627964;113.679214,23.627869;113.679236,23.627778;113.67928,23.627526;113.679288,23.627322;113.679288,23.627322;113.679253,23.626853;113.679184,23.626623;113.679141,23.626497;113.679002,23.626259;113.678941,23.626176;113.678711,23.625977;113.67862,23.625864;113.678529,23.62572;113.678438,23.625191;113.678429,23.625056;113.678451,23.624939;113.678572,23.624657',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向西南步行722米左转',\n",
       "    'orientation': '西南',\n",
       "    'road': [],\n",
       "    'distance': '722',\n",
       "    'duration': '578',\n",
       "    'polyline': '113.678572,23.624653;113.678559,23.62451;113.678416,23.624323;113.678416,23.624323;113.677582,23.623793;113.676532,23.623346;113.676363,23.623255;113.676272,23.623151;113.676111,23.622834;113.676042,23.622739;113.67579,23.622483;113.675499,23.622279;113.675417,23.622174;113.675386,23.622088;113.675378,23.621836;113.675378,23.621836;113.675391,23.62161;113.675434,23.621476;113.675543,23.621359;113.675764,23.621181;113.675846,23.621089;113.675903,23.620994;113.675907,23.620855;113.675877,23.620725;113.675747,23.620547;113.675599,23.620373;113.675243,23.620013',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向东南步行412米向右前方行走',\n",
       "    'orientation': '东南',\n",
       "    'road': [],\n",
       "    'distance': '412',\n",
       "    'duration': '330',\n",
       "    'polyline': '113.675239,23.620009;113.67549,23.620013;113.675642,23.619991;113.675773,23.619948;113.676016,23.619796;113.676901,23.619193;113.677261,23.618785;113.678069,23.61783;113.678069,23.61783;113.678181,23.617656',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿乌土街向南步行1381米右转',\n",
       "    'orientation': '南',\n",
       "    'road': '乌土街',\n",
       "    'distance': '1381',\n",
       "    'duration': '1105',\n",
       "    'polyline': '113.678181,23.617652;113.678095,23.617205;113.678051,23.617075;113.677973,23.616923;113.677743,23.616558;113.677609,23.616289;113.677391,23.615816;113.677339,23.615668;113.67714,23.614826;113.677049,23.614323;113.676927,23.613359;113.676845,23.612786;113.676602,23.611489;113.676415,23.610438;113.676411,23.610265;113.676411,23.610265;113.676489,23.609848;113.676502,23.609622;113.676493,23.609236;113.676415,23.608746;113.676415,23.608485;113.67648,23.60819;113.67661,23.607734;113.676819,23.606736;113.676862,23.606541;113.676914,23.606415;113.677014,23.606254;113.677535,23.605673',\n",
       "    'action': '右转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿乌土街向西南步行165米直行',\n",
       "    'orientation': '西南',\n",
       "    'road': '乌土街',\n",
       "    'distance': '165',\n",
       "    'duration': '132',\n",
       "    'polyline': '113.677535,23.605668;113.676988,23.605373;113.676402,23.605;113.676163,23.604887',\n",
       "    'action': '直行',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿934县道向西步行118米直行',\n",
       "    'orientation': '西',\n",
       "    'road': '934县道',\n",
       "    'distance': '118',\n",
       "    'duration': '94',\n",
       "    'polyline': '113.676159,23.604883;113.675799,23.604805;113.675508,23.604779;113.675508,23.604779;113.675013,23.60474',\n",
       "    'action': '直行',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿桃园东路向西南步行674米向右前方行走',\n",
       "    'orientation': '西南',\n",
       "    'road': '桃园东路',\n",
       "    'distance': '674',\n",
       "    'duration': '539',\n",
       "    'polyline': '113.675009,23.604735;113.674236,23.604683;113.673893,23.604618;113.673464,23.604492;113.673464,23.604492;113.67168,23.604006;113.671541,23.603958;113.671411,23.603854;113.671068,23.603472;113.670807,23.603264;113.670807,23.603264;113.670525,23.603073;113.6702,23.602904;113.6702,23.602904;113.670022,23.602795;113.670022,23.602795;113.669909,23.602682;113.669818,23.602517;113.669787,23.602413;113.669718,23.601901',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿桃园东路向西南步行247米直行',\n",
       "    'orientation': '西南',\n",
       "    'road': '桃园东路',\n",
       "    'distance': '247',\n",
       "    'duration': '198',\n",
       "    'polyline': '113.669714,23.601897;113.66964,23.601771;113.66964,23.601771;113.669488,23.601558;113.669488,23.601558;113.668789,23.600859;113.668663,23.600768;113.668663,23.600768;113.668442,23.600647;113.667947,23.600417',\n",
       "    'action': '直行',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿桃园西路向西南步行2775米向右前方行走',\n",
       "    'orientation': '西南',\n",
       "    'road': '桃园西路',\n",
       "    'distance': '2775',\n",
       "    'duration': '2220',\n",
       "    'polyline': '113.667943,23.600412;113.667331,23.600139;113.667331,23.600139;113.666224,23.599644;113.665955,23.599505;113.665955,23.599505;113.665781,23.599362;113.665781,23.599362;113.665521,23.599093;113.665521,23.599093;113.665286,23.598824;113.665286,23.598824;113.665256,23.598785;113.665256,23.598785;113.664796,23.598238;113.664796,23.598238;113.664401,23.597622;113.664401,23.597622;113.664071,23.59714;113.663746,23.59678;113.663746,23.59678;113.663477,23.59651;113.663477,23.59651;113.66224,23.595434;113.66224,23.595434;113.661563,23.594848;113.661563,23.594848;113.661311,23.594605;113.66115,23.594414;113.660907,23.594032;113.660907,23.594032;113.660829,23.593889;113.660729,23.593598;113.660547,23.593025;113.660464,23.592804;113.660464,23.592804;113.659931,23.591593;113.659831,23.591393;113.659631,23.59105;113.659631,23.59105;113.659115,23.59023;113.658824,23.589592;113.658824,23.589592;113.658754,23.589405;113.658754,23.589405;113.657817,23.58714;113.657747,23.586936;113.657695,23.586693;113.657548,23.585369;113.657548,23.585369;113.657483,23.585161;113.657326,23.584896;113.657326,23.584896;113.657114,23.58457;113.657062,23.584453;113.65691,23.583924;113.656884,23.583785;113.656879,23.583681;113.656888,23.583572;113.656979,23.58326;113.657066,23.58303;113.657157,23.582852;113.657378,23.582539;113.657431,23.582444;113.65747,23.582344;113.657483,23.582235;113.657483,23.582109;113.657435,23.580777;113.657405,23.580616;113.657405,23.580616;113.657296,23.580308;113.657244,23.580221;113.656723,23.579644;113.656723,23.579644;113.656597,23.579488;113.656411,23.579362',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿石海工业大道向西南步行1838米直行',\n",
       "    'orientation': '西南',\n",
       "    'road': '石海工业大道',\n",
       "    'distance': '1838',\n",
       "    'duration': '1470',\n",
       "    'polyline': '113.656406,23.579358;113.656055,23.57931;113.656055,23.57931;113.655091,23.579089;113.654918,23.579023;113.654566,23.57885;113.654566,23.57885;113.653681,23.578372;113.653681,23.578372;113.653429,23.578247;113.653429,23.578247;113.652713,23.577865;113.652713,23.577865;113.652452,23.577704;113.652001,23.577387;113.652001,23.577387;113.651654,23.577105;113.651654,23.577105;113.651437,23.57694;113.651437,23.57694;113.650681,23.576332;113.650681,23.576332;113.650378,23.576094;113.650378,23.576094;113.649674,23.575534;113.649674,23.575534;113.649583,23.575451;113.649583,23.575451;113.64924,23.575182;113.64924,23.575182;113.647409,23.573754;113.647409,23.573754;113.647279,23.573641;113.646793,23.573155;113.646793,23.573155;113.64661,23.57296;113.64661,23.57296;113.646419,23.572778;113.646419,23.572778;113.646202,23.572565;113.645968,23.57237;113.645252,23.571866;113.645252,23.571866;113.644974,23.571732;113.644974,23.571732;113.644883,23.571706;113.644618,23.571671;113.643967,23.571675;113.643967,23.571675;113.643511,23.57168;113.643511,23.57168;113.64329,23.57168;113.643047,23.571654;113.64293,23.571632;113.642548,23.571502;113.642326,23.571411;113.641979,23.571228;113.641636,23.571003;113.641636,23.571003;113.641437,23.57082',\n",
       "    'action': '直行',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿政通路向西南步行2161米直行',\n",
       "    'orientation': '西南',\n",
       "    'road': '政通路',\n",
       "    'distance': '2161',\n",
       "    'duration': '1729',\n",
       "    'polyline': '113.641432,23.570816;113.641168,23.570525;113.641168,23.570525;113.640964,23.570265;113.640864,23.570156;113.640864,23.570156;113.640651,23.569978;113.640408,23.569822;113.638902,23.569006;113.638902,23.569006;113.638398,23.568746;113.638056,23.568611;113.637695,23.568529;113.637431,23.568507;113.637209,23.568516;113.637209,23.568516;113.636836,23.568576;113.636836,23.568576;113.636484,23.568676;113.636484,23.568676;113.635334,23.569058;113.633754,23.569614;113.633485,23.569674;113.633251,23.569692;113.633251,23.569692;113.633069,23.569688;113.633069,23.569688;113.632778,23.569635;113.632378,23.569492;113.631992,23.569319;113.631853,23.569223;113.631801,23.569158;113.631701,23.568997;113.631441,23.568338;113.631441,23.568338;113.63128,23.567947;113.63128,23.567947;113.63122,23.567834;113.631089,23.567656;113.630946,23.567526;113.630768,23.567387;113.630768,23.567387;113.630456,23.567157;113.630456,23.567157;113.630113,23.566884;113.630113,23.566884;113.629596,23.566458;113.629063,23.565799;113.628359,23.565174;113.62826,23.565026;113.62806,23.564592;113.627665,23.56395;113.627574,23.563815;113.627413,23.56365;113.626576,23.563003;113.626254,23.562804;113.625964,23.562682;113.624987,23.562365',\n",
       "    'action': '直行',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿灌村路向西步行781米左转',\n",
       "    'orientation': '西',\n",
       "    'road': '灌村路',\n",
       "    'distance': '781',\n",
       "    'duration': '625',\n",
       "    'polyline': '113.624983,23.562361;113.624431,23.562183;113.62349,23.56191;113.623216,23.561771;113.623003,23.561593;113.622661,23.561185;113.622049,23.560525;113.621936,23.560421;113.621775,23.560317;113.621515,23.560226;113.620226,23.559926;113.619579,23.559761;113.619427,23.559744;113.619427,23.559744;113.619188,23.559731;113.619188,23.559731;113.618555,23.559796;113.618355,23.559839;113.618251,23.559887',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿环市东路向西南步行1583米向右前方行走',\n",
       "    'orientation': '西南',\n",
       "    'road': '环市东路',\n",
       "    'distance': '1583',\n",
       "    'duration': '1266',\n",
       "    'polyline': '113.618247,23.559887;113.617626,23.559271;113.617626,23.559271;113.615794,23.557474;113.615794,23.557474;113.615213,23.556905;113.615213,23.556905;113.614093,23.55579;113.614093,23.55579;113.613832,23.55549;113.613832,23.55549;113.613628,23.555217;113.613628,23.555217;113.613429,23.554926;113.613429,23.554926;113.613138,23.554418;113.612778,23.553516;113.612778,23.553516;113.612756,23.553442;113.612756,23.553442;113.612682,23.553251;113.612682,23.553251;113.612656,23.553181;113.612656,23.553181;113.612344,23.552339;113.612344,23.552339;113.612192,23.551949;113.612192,23.551949;113.61207,23.551658;113.611888,23.551354;113.611606,23.550968;113.611476,23.550812;113.611246,23.550577;113.610551,23.55;113.610551,23.55;113.610065,23.549609;113.610065,23.549609;113.609514,23.549162;113.609514,23.549162;113.609071,23.548746;113.609071,23.548746;113.608971,23.548641',\n",
       "    'action': '向右前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿河东北路向西步行1383米向左前方行走',\n",
       "    'orientation': '西',\n",
       "    'road': '河东北路',\n",
       "    'distance': '1383',\n",
       "    'duration': '1106',\n",
       "    'polyline': '113.608967,23.548637;113.608767,23.548576;113.608767,23.548576;113.608589,23.548503;113.607548,23.547921;113.607548,23.547921;113.606918,23.54763;113.606918,23.54763;113.606875,23.547613;113.606875,23.547613;113.60648,23.547439;113.60648,23.547439;113.60477,23.546671;113.60477,23.546671;113.604701,23.546641;113.604701,23.546641;113.60424,23.546471;113.603954,23.54638;113.603555,23.546289;113.603555,23.546289;113.603108,23.546233;113.603108,23.546233;113.602839,23.546207;113.602839,23.546207;113.602296,23.546194;113.602075,23.546198;113.602075,23.546198;113.601628,23.546228;113.601628,23.546228;113.600985,23.546259;113.600985,23.546259;113.600321,23.54628;113.600321,23.54628;113.600304,23.54628;113.600304,23.54628;113.599618,23.546306;113.599076,23.546306;113.599076,23.546306;113.598498,23.54628;113.598498,23.54628;113.597439,23.546233;113.597439,23.546233;113.596806,23.546155;113.596806,23.546155;113.596276,23.546085;113.596276,23.546085;113.595964,23.546029',\n",
       "    'action': '向左前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿河东北路向西南步行60米向左前方行走',\n",
       "    'orientation': '西南',\n",
       "    'road': '河东北路',\n",
       "    'distance': '60',\n",
       "    'duration': '48',\n",
       "    'polyline': '113.595959,23.546024;113.595803,23.545964;113.59572,23.545907;113.595642,23.545842;113.595547,23.545673',\n",
       "    'action': '向左前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿河东北路向南步行129米右转',\n",
       "    'orientation': '南',\n",
       "    'road': '河东北路',\n",
       "    'distance': '129',\n",
       "    'duration': '103',\n",
       "    'polyline': '113.595543,23.545668;113.595486,23.545386;113.595486,23.545386;113.595486,23.545308;113.595525,23.545135;113.595525,23.545135;113.595764,23.54454',\n",
       "    'action': '右转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿355省道向西步行407米直行',\n",
       "    'orientation': '西',\n",
       "    'road': '355省道',\n",
       "    'distance': '407',\n",
       "    'duration': '326',\n",
       "    'polyline': '113.595764,23.544536;113.595681,23.544536;113.595681,23.544536;113.595547,23.544536;113.595547,23.544536;113.595269,23.544536;113.595269,23.544536;113.594957,23.544588;113.594631,23.544674;113.594631,23.544674;113.594575,23.544692;113.594575,23.544692;113.592144,23.545369;113.592144,23.545369;113.591892,23.545447',\n",
       "    'action': '直行',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿新城东路向西北步行527米向左前方行走',\n",
       "    'orientation': '西北',\n",
       "    'road': '新城东路',\n",
       "    'distance': '527',\n",
       "    'duration': '422',\n",
       "    'polyline': '113.591888,23.545447;113.591784,23.545516;113.591784,23.545516;113.590738,23.546155;113.590738,23.546155;113.590404,23.546367;113.590404,23.546367;113.590043,23.546584;113.590043,23.546584;113.589779,23.546745;113.589779,23.546745;113.589518,23.546905;113.589518,23.546905;113.587708,23.548021;113.587708,23.548021;113.587574,23.548116',\n",
       "    'action': '向左前方行走',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '沿新城东路向西步行112米右转',\n",
       "    'orientation': '西',\n",
       "    'road': '新城东路',\n",
       "    'distance': '112',\n",
       "    'duration': '90',\n",
       "    'polyline': '113.587569,23.548116;113.587474,23.548108;113.587474,23.548108;113.586467,23.548121',\n",
       "    'action': '右转',\n",
       "    'assistant_action': [],\n",
       "    'walk_type': '0'},\n",
       "   {'instruction': '向北步行80米到达目的地',\n",
       "    'orientation': '北',\n",
       "    'road': [],\n",
       "    'distance': '80',\n",
       "    'duration': '64',\n",
       "    'polyline': '113.586463,23.548121;113.586463,23.548286;113.586463,23.548286;113.586476,23.548624;113.586476,23.548624;113.586489,23.548854',\n",
       "    'action': [],\n",
       "    'assistant_action': '到达目的地',\n",
       "    'walk_type': '0'}]}]"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()['route']['paths']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 路径规划（公交车）(暨南大学——猎德）"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.公交URL：https://restapi.amap.com/v3/direction/transit/integrated?parameters    \n",
    "2.请求方式：request.get   \n",
    "3.必填参数：key,origin,destination,city   "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    " import requests,json\n",
    " import pandas as pd \n",
    " import geo\n",
    " key = \"ef5367355e3cb0820fff00cb4548cf5d\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "def bus(key,origin,destination,city):\n",
    "    bus_url = \"https://restapi.amap.com/v3/direction/transit/integrated?parameters\"\n",
    "    params ={\n",
    "        \"key\":key,\n",
    "        \"origin\":origin,\n",
    "        \"destination\":destination,\n",
    "        \"city\":city\n",
    "    }\n",
    "    r = requests.get(bus_url,params=params)\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[{'formatted_address': '广东省广州市天河区暨南大学', 'country': '中国', 'province': '广东省', 'citycode': '020', 'city': '广州市', 'district': '天河区', 'township': [], 'neighborhood': {'name': [], 'type': []}, 'building': {'name': [], 'type': []}, 'adcode': '440106', 'street': [], 'number': [], 'location': '113.350961,23.131577', 'level': '兴趣点'}]\n",
      "[{'formatted_address': '广东省广州市天河区猎德', 'country': '中国', 'province': '广东省', 'citycode': '020', 'city': '广州市', 'district': '天河区', 'township': [], 'neighborhood': {'name': [], 'type': []}, 'building': {'name': [], 'type': []}, 'adcode': '440106', 'street': [], 'number': [], 'location': '113.336127,23.113409', 'level': '兴趣点'}]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'status': '0', 'info': 'INVALID_PARAMS', 'infocode': '20000'}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "origin = \"广东省广州市暨南大学\"\n",
    "location_orgin = geo.geocode(key,origin)\n",
    "print(location_orgin)\n",
    "destination = \"广东省广州市猎德\"\n",
    "location_destination = geo.geocode(key,destination)\n",
    "print(location_destination)\n",
    "city = \"广州\" \n",
    "results_bus =  bus(key,location_orgin,location_destination,city)\n",
    "results_bus\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'1.0.5'"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.__version__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "pandas 处理时：{},\n",
    "1、当表格为一行时，可直接去列name\n",
    "2、当表格为多行时，去某一行（列表）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'transits'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-21-673bc057d51d>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0m_669路_bus\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mjson_normalize\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresults_bus\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'transits'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'segments'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'bus'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'buslines'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[0m_669路_bus\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mKeyError\u001b[0m: 'transits'"
     ]
    }
   ],
   "source": [
    "_669路_walking = pd.json_normalize(results_bus['route']['transits'][0]['segments'][0]['walking']['steps'])\n",
    "_669路_bus = pd.json_normalize(results_bus['route']['transits'][0]['segments'][0]['bus']['buslines'])\n",
    "_669路_walking\n",
    "_669路_bus"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 驾车路径规划：\n",
    "\n",
    "1.驾车路径规划API URL：https://restapi.amap.com/v3/direction/driving?parameters   \n",
    "2.请求方式：request.get   \n",
    "3.必填参数：key,origin,destination "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据准备： \n",
    "origin = \"广东省广州市中山大学南方学院\"\n",
    "destination = \"广州市从化区龙岗\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import requests,json\n",
    "yan_key = \"ef5367355e3cb0820fff00cb4548cf5d\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "def geocode(key,address,city=None,batch=None)->str:\n",
    "    \"\"\"获取高德API的地理编码\n",
    "    注释：key是指高德API的秘钥，请先去注册\n",
    "          address是指结构化地址，具体请查看：https://lbs.amap.com/api/webservice/guide/api/georegeo   \n",
    "    \"\"\"\n",
    "    url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"address\":address,\n",
    "        \"city\":city,\n",
    "        \"batch\":batch\n",
    "    }\n",
    "    response = requests.get(url,params=params)\n",
    "    results = response.json()['geocodes'][0]['location']\n",
    "    # 返回值\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.679287,23.632575'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "中大南方_location = geocode(yan_key,origin)\n",
    "中大南方_location"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.668051,23.600869'"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "龙岗_location = geocode(yan_key,destination)\n",
    "龙岗_location"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "url = \"https://restapi.amap.com/v3/direction/driving?parameters\"\n",
    "params = {\n",
    "    \"key\":yan_key,\n",
    "    \"origin\":中大南方_location,\n",
    "    \"destination\":龙岗_location\n",
    "}\n",
    "r = requests.get(url,params)\n",
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'distance': '5576',\n",
       "  'duration': '777',\n",
       "  'strategy': '速度最快',\n",
       "  'tolls': '0',\n",
       "  'toll_distance': '0',\n",
       "  'steps': [{'instruction': '向南行驶9米左转',\n",
       "    'orientation': '南',\n",
       "    'distance': '9',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '5',\n",
       "    'polyline': '113.679596,23.632574;113.679596,23.632491',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '9',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.679596,23.632574;113.679596,23.632491'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]},\n",
       "   {'instruction': '向东行驶100米右转',\n",
       "    'orientation': '东',\n",
       "    'distance': '100',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '25',\n",
       "    'polyline': '113.679596,23.632491;113.680582,23.632522',\n",
       "    'action': '右转',\n",
       "    'assistant_action': [],\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '100',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.679596,23.632491;113.680582,23.632522'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]},\n",
       "   {'instruction': '向南行驶199米向右前方行驶',\n",
       "    'orientation': '南',\n",
       "    'distance': '199',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '51',\n",
       "    'polyline': '113.680582,23.632522;113.680642,23.632135;113.680668,23.631736;113.680642,23.631589;113.680629,23.631536;113.68059,23.631432;113.680499,23.631237;113.680399,23.631089;113.680204,23.630838',\n",
       "    'action': '向右前方行驶',\n",
       "    'assistant_action': [],\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '122',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.680582,23.632522;113.680642,23.632135;113.680668,23.631736;113.680642,23.631589;113.680629,23.631536;113.68059,23.631432'},\n",
       "     {'lcode': [],\n",
       "      'distance': '77',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.68059,23.631432;113.680499,23.631237;113.680399,23.631089;113.680204,23.630838'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]},\n",
       "   {'instruction': '向西行驶159米左转',\n",
       "    'orientation': '西',\n",
       "    'distance': '159',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '31',\n",
       "    'polyline': '113.680204,23.630838;113.68003,23.630768;113.67964,23.630634;113.679358,23.630516;113.679197,23.630469;113.678711,23.63036',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '18',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.680204,23.630838;113.68003,23.630768'},\n",
       "     {'lcode': [],\n",
       "      'distance': '42',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.68003,23.630768;113.67964,23.630634'},\n",
       "     {'lcode': [],\n",
       "      'distance': '48',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.67964,23.630634;113.679358,23.630516;113.679197,23.630469'},\n",
       "     {'lcode': [],\n",
       "      'distance': '51',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.679197,23.630469;113.678711,23.63036'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]},\n",
       "   {'instruction': '向南行驶237米左转',\n",
       "    'orientation': '南',\n",
       "    'distance': '237',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '63',\n",
       "    'polyline': '113.678711,23.63036;113.678711,23.629336;113.678698,23.629128;113.678663,23.629054;113.678572,23.628984;113.67842,23.628898;113.678364,23.628837;113.678325,23.628772;113.678299,23.628646;113.678273,23.628372',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '113',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.678711,23.63036;113.678711,23.629336'},\n",
       "     {'lcode': [],\n",
       "      'distance': '124',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.678711,23.629336;113.678698,23.629128;113.678663,23.629054;113.678572,23.628984;113.67842,23.628898;113.678364,23.628837;113.678325,23.628772;113.678299,23.628646;113.678273,23.628372'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]},\n",
       "   {'instruction': '向东南行驶105米向右前方行驶',\n",
       "    'orientation': '东南',\n",
       "    'distance': '105',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '49',\n",
       "    'polyline': '113.678273,23.628372;113.678572,23.628333;113.678689,23.628303;113.678845,23.628234;113.679045,23.628069;113.679162,23.62796',\n",
       "    'action': '向右前方行驶',\n",
       "    'assistant_action': [],\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '43',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.678273,23.628372;113.678572,23.628333;113.678689,23.628303'},\n",
       "     {'lcode': [],\n",
       "      'distance': '62',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.678689,23.628303;113.678845,23.628234;113.679045,23.628069;113.679162,23.62796'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]},\n",
       "   {'instruction': '向南行驶393米向右前方行驶',\n",
       "    'orientation': '南',\n",
       "    'distance': '393',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '66',\n",
       "    'polyline': '113.679162,23.62796;113.679214,23.627865;113.679236,23.627773;113.67928,23.627522;113.679288,23.627318;113.679249,23.626849;113.679184,23.626619;113.679136,23.626493;113.679002,23.62625;113.678937,23.626172;113.678707,23.625972;113.678615,23.625859;113.678529,23.625716;113.678507,23.625634;113.678433,23.625187;113.678424,23.625052;113.678455,23.624931;113.678572,23.624653',\n",
       "    'action': '向右前方行驶',\n",
       "    'assistant_action': [],\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '72',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.679162,23.62796;113.679214,23.627865;113.679236,23.627773;113.67928,23.627522;113.679288,23.627318'},\n",
       "     {'lcode': [],\n",
       "      'distance': '321',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.679288,23.627318;113.679249,23.626849;113.679184,23.626619;113.679136,23.626493;113.679002,23.62625;113.678937,23.626172;113.678707,23.625972;113.678615,23.625859;113.678529,23.625716;113.678507,23.625634;113.678433,23.625187;113.678424,23.625052;113.678455,23.624931;113.678572,23.624653'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]},\n",
       "   {'instruction': '沿源富街途径源湖街向西南行驶2.4千米左转',\n",
       "    'orientation': '西南',\n",
       "    'road': '源富街',\n",
       "    'distance': '2351',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '253',\n",
       "    'polyline': '113.678572,23.624653;113.678555,23.624505;113.678411,23.624323;113.677578,23.623789;113.676528,23.623346;113.676354,23.623247;113.676263,23.623147;113.676102,23.62283;113.676037,23.622734;113.675786,23.622474;113.675499,23.62227;113.675412,23.62217;113.675378,23.622083;113.675373,23.621832;113.675391,23.621606;113.675438,23.621471;113.675538,23.621354;113.675764,23.621176;113.675851,23.621085;113.675898,23.62099;113.675911,23.620851;113.675868,23.62072;113.675786,23.620603;113.675742,23.620543;113.675595,23.620369;113.675239,23.620009;113.674931,23.619714;113.673919,23.61862;113.673689,23.618429;113.673459,23.618333;113.673216,23.618268;113.671081,23.617786;113.667895,23.617096;113.666341,23.616736;113.665916,23.616649;113.664549,23.616345;113.663585,23.616128;113.663507,23.616107;113.663225,23.616042;113.662569,23.615911;113.662027,23.615803;113.661684,23.615712;113.660404,23.615417',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '42',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.678572,23.624653;113.678555,23.624505;113.678411,23.624323'},\n",
       "     {'lcode': [],\n",
       "      'distance': '435',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.678411,23.624323;113.677578,23.623789;113.676528,23.623346;113.676354,23.623247;113.676263,23.623147;113.676102,23.62283;113.676037,23.622734;113.675786,23.622474;113.675499,23.62227;113.675412,23.62217;113.675378,23.622083;113.675373,23.621832'},\n",
       "     {'lcode': [],\n",
       "      'distance': '245',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.675373,23.621832;113.675391,23.621606;113.675438,23.621471;113.675538,23.621354;113.675764,23.621176;113.675851,23.621085;113.675898,23.62099;113.675911,23.620851;113.675868,23.62072;113.675786,23.620603;113.675742,23.620543;113.675595,23.620369;113.675239,23.620009'},\n",
       "     {'lcode': [],\n",
       "      'distance': '512',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.675239,23.620009;113.674931,23.619714;113.673919,23.61862;113.673689,23.618429;113.673459,23.618333;113.673216,23.618268;113.671081,23.617786'},\n",
       "     {'lcode': [],\n",
       "      'distance': '334',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.671081,23.617786;113.667895,23.617096'},\n",
       "     {'lcode': [],\n",
       "      'distance': '163',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.667895,23.617096;113.666341,23.616736'},\n",
       "     {'lcode': [],\n",
       "      'distance': '44',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.666341,23.616736;113.665916,23.616649'},\n",
       "     {'lcode': [],\n",
       "      'distance': '244',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.665916,23.616649;113.664549,23.616345;113.663585,23.616128'},\n",
       "     {'lcode': [],\n",
       "      'distance': '8',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.663585,23.616128;113.663507,23.616107'},\n",
       "     {'lcode': [],\n",
       "      'distance': '29',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.663507,23.616107;113.663225,23.616042'},\n",
       "     {'lcode': [],\n",
       "      'distance': '68',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.663225,23.616042;113.662569,23.615911'},\n",
       "     {'lcode': [],\n",
       "      'distance': '93',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.662569,23.615911;113.662027,23.615803;113.661684,23.615712'},\n",
       "     {'lcode': [],\n",
       "      'distance': '134',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.661684,23.615712;113.660404,23.615417'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]},\n",
       "   {'instruction': '沿龙泉路向东南行驶1.9千米左转',\n",
       "    'orientation': '东南',\n",
       "    'road': '龙泉路',\n",
       "    'distance': '1858',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '179',\n",
       "    'polyline': '113.660404,23.615417;113.660872,23.61513;113.661315,23.614831;113.661619,23.614596;113.661667,23.614527;113.661736,23.614349;113.661797,23.614145;113.661862,23.614006;113.661914,23.613937;113.662079,23.613789;113.662613,23.613381;113.662756,23.61322;113.662804,23.613142;113.66434,23.609618;113.664549,23.609128;113.665095,23.607891;113.665694,23.606523;113.667018,23.602865;113.667179,23.602465;113.667361,23.601984;113.667465,23.601688;113.667565,23.601437;113.667665,23.601159;113.667773,23.600877;113.667943,23.600412',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '113',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.660404,23.615417;113.660872,23.61513;113.661315,23.614831'},\n",
       "     {'lcode': [],\n",
       "      'distance': '70',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.661315,23.614831;113.661619,23.614596;113.661667,23.614527;113.661736,23.614349'},\n",
       "     {'lcode': [],\n",
       "      'distance': '23',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.661736,23.614349;113.661797,23.614145'},\n",
       "     {'lcode': [],\n",
       "      'distance': '153',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.661797,23.614145;113.661862,23.614006;113.661914,23.613937;113.662079,23.613789;113.662613,23.613381;113.662756,23.61322;113.662804,23.613142'},\n",
       "     {'lcode': [],\n",
       "      'distance': '626',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.662804,23.613142;113.66434,23.609618;113.664549,23.609128;113.665095,23.607891'},\n",
       "     {'lcode': [],\n",
       "      'distance': '163',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.665095,23.607891;113.665694,23.606523'},\n",
       "     {'lcode': [],\n",
       "      'distance': '426',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.665694,23.606523;113.667018,23.602865'},\n",
       "     {'lcode': [],\n",
       "      'distance': '47',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.667018,23.602865;113.667179,23.602465'},\n",
       "     {'lcode': [],\n",
       "      'distance': '56',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.667179,23.602465;113.667361,23.601984'},\n",
       "     {'lcode': [],\n",
       "      'distance': '34',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.667361,23.601984;113.667465,23.601688'},\n",
       "     {'lcode': [],\n",
       "      'distance': '29',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.667465,23.601688;113.667565,23.601437'},\n",
       "     {'lcode': [],\n",
       "      'distance': '32',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.667565,23.601437;113.667665,23.601159'},\n",
       "     {'lcode': [],\n",
       "      'distance': '32',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.667665,23.601159;113.667773,23.600877'},\n",
       "     {'lcode': [],\n",
       "      'distance': '54',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.667773,23.600877;113.667943,23.600412'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]},\n",
       "   {'instruction': '沿桃园东路向东北行驶82米左转',\n",
       "    'orientation': '东北',\n",
       "    'road': '桃园东路',\n",
       "    'distance': '82',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '15',\n",
       "    'polyline': '113.667943,23.600412;113.668437,23.600642;113.668663,23.600764',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '82',\n",
       "      'status': '畅通',\n",
       "      'polyline': '113.667943,23.600412;113.668437,23.600642;113.668663,23.600764'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]},\n",
       "   {'instruction': '沿龙岗福安街向西北行驶48米左转',\n",
       "    'orientation': '西北',\n",
       "    'road': '龙岗福安街',\n",
       "    'distance': '48',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '28',\n",
       "    'polyline': '113.668663,23.600764;113.668451,23.601003;113.668398,23.60112',\n",
       "    'action': '左转',\n",
       "    'assistant_action': [],\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '48',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.668663,23.600764;113.668451,23.601003;113.668398,23.60112'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]},\n",
       "   {'instruction': '向西行驶35米到达目的地',\n",
       "    'orientation': '西',\n",
       "    'distance': '35',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'toll_road': [],\n",
       "    'duration': '12',\n",
       "    'polyline': '113.668398,23.60112;113.668325,23.601094;113.668095,23.601011;113.668077,23.601016',\n",
       "    'action': [],\n",
       "    'assistant_action': '到达目的地',\n",
       "    'tmcs': [{'lcode': [],\n",
       "      'distance': '8',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.668398,23.60112;113.668325,23.601094'},\n",
       "     {'lcode': [],\n",
       "      'distance': '27',\n",
       "      'status': '未知',\n",
       "      'polyline': '113.668325,23.601094;113.668095,23.601011;113.668077,23.601016'}],\n",
       "    'cities': [{'name': '广州市',\n",
       "      'citycode': '020',\n",
       "      'adcode': '440100',\n",
       "      'districts': [{'name': '从化区', 'adcode': '440117'}]}]}],\n",
       "  'restriction': '0',\n",
       "  'traffic_lights': '0'}]"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()['route']['paths']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 行政区域查询：\n",
    "\n",
    "1.行政区域查询API服务地址URL:https://restapi.amap.com/v3/config/district?parameters    \n",
    "\n",
    "2.请求方式：request.get   \n",
    "\n",
    "3.必填参数：key\n",
    "\n",
    "4.选填参数：keywords"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def district(key,keywords,subdistrict,extensions=None)->dict:\n",
    "    district_url = \"https://restapi.amap.com/v3/config/district?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"keywords\":keywords,\n",
    "        \"subdistrict\":subdistrict,\n",
    "        \"extensions\":extensions\n",
    "    }\n",
    "    r = requests.get(district_url,params = params)\n",
    "    # 返回值\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'suggestion': {'keywords': [], 'cities': []},\n",
       " 'districts': [{'citycode': [],\n",
       "   'adcode': '440000',\n",
       "   'name': '广东省',\n",
       "   'center': '113.280637,23.125178',\n",
       "   'level': 'province',\n",
       "   'districts': [{'citycode': '0754',\n",
       "     'adcode': '440500',\n",
       "     'name': '汕头市',\n",
       "     'center': '116.708463,23.37102',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0754',\n",
       "       'adcode': '440523',\n",
       "       'name': '南澳县',\n",
       "       'center': '117.027105,23.419562',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440513',\n",
       "       'name': '潮阳区',\n",
       "       'center': '116.602602,23.262336',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440515',\n",
       "       'name': '澄海区',\n",
       "       'center': '116.76336,23.46844',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440512',\n",
       "       'name': '濠江区',\n",
       "       'center': '116.729528,23.279345',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440514',\n",
       "       'name': '潮南区',\n",
       "       'center': '116.423607,23.249798',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440507',\n",
       "       'name': '龙湖区',\n",
       "       'center': '116.732015,23.373754',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0754',\n",
       "       'adcode': '440511',\n",
       "       'name': '金平区',\n",
       "       'center': '116.703583,23.367071',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0757',\n",
       "     'adcode': '440600',\n",
       "     'name': '佛山市',\n",
       "     'center': '113.122717,23.028762',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0757',\n",
       "       'adcode': '440607',\n",
       "       'name': '三水区',\n",
       "       'center': '112.899414,23.16504',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0757',\n",
       "       'adcode': '440608',\n",
       "       'name': '高明区',\n",
       "       'center': '112.882123,22.893855',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0757',\n",
       "       'adcode': '440606',\n",
       "       'name': '顺德区',\n",
       "       'center': '113.281826,22.75851',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0757',\n",
       "       'adcode': '440604',\n",
       "       'name': '禅城区',\n",
       "       'center': '113.112414,23.019643',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0757',\n",
       "       'adcode': '440605',\n",
       "       'name': '南海区',\n",
       "       'center': '113.145577,23.031562',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0758',\n",
       "     'adcode': '441200',\n",
       "     'name': '肇庆市',\n",
       "     'center': '112.472529,23.051546',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0758',\n",
       "       'adcode': '441225',\n",
       "       'name': '封开县',\n",
       "       'center': '111.502973,23.434731',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441224',\n",
       "       'name': '怀集县',\n",
       "       'center': '112.182466,23.913072',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441223',\n",
       "       'name': '广宁县',\n",
       "       'center': '112.440419,23.631486',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441226',\n",
       "       'name': '德庆县',\n",
       "       'center': '111.78156,23.141711',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441284',\n",
       "       'name': '四会市',\n",
       "       'center': '112.695028,23.340324',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441203',\n",
       "       'name': '鼎湖区',\n",
       "       'center': '112.565249,23.155822',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441204',\n",
       "       'name': '高要区',\n",
       "       'center': '112.460846,23.027694',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0758',\n",
       "       'adcode': '441202',\n",
       "       'name': '端州区',\n",
       "       'center': '112.472329,23.052662',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0752',\n",
       "     'adcode': '441300',\n",
       "     'name': '惠州市',\n",
       "     'center': '114.412599,23.079404',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0752',\n",
       "       'adcode': '441323',\n",
       "       'name': '惠东县',\n",
       "       'center': '114.723092,22.983036',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0752',\n",
       "       'adcode': '441322',\n",
       "       'name': '博罗县',\n",
       "       'center': '114.284254,23.167575',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0752',\n",
       "       'adcode': '441324',\n",
       "       'name': '龙门县',\n",
       "       'center': '114.259986,23.723894',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0752',\n",
       "       'adcode': '441303',\n",
       "       'name': '惠阳区',\n",
       "       'center': '114.469444,22.78851',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0752',\n",
       "       'adcode': '441302',\n",
       "       'name': '惠城区',\n",
       "       'center': '114.413978,23.079883',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0755',\n",
       "     'adcode': '440300',\n",
       "     'name': '深圳市',\n",
       "     'center': '114.085947,22.547',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0755',\n",
       "       'adcode': '440306',\n",
       "       'name': '宝安区',\n",
       "       'center': '113.828671,22.754741',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440305',\n",
       "       'name': '南山区',\n",
       "       'center': '113.92943,22.531221',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440308',\n",
       "       'name': '盐田区',\n",
       "       'center': '114.235366,22.555069',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440304',\n",
       "       'name': '福田区',\n",
       "       'center': '114.05096,22.541009',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440303',\n",
       "       'name': '罗湖区',\n",
       "       'center': '114.123885,22.555341',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440307',\n",
       "       'name': '龙岗区',\n",
       "       'center': '114.251372,22.721511',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440310',\n",
       "       'name': '坪山区',\n",
       "       'center': '114.338441,22.69423',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440311',\n",
       "       'name': '光明区',\n",
       "       'center': '113.935895,22.748816',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0755',\n",
       "       'adcode': '440309',\n",
       "       'name': '龙华区',\n",
       "       'center': '114.044346,22.691963',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0756',\n",
       "     'adcode': '440400',\n",
       "     'name': '珠海市',\n",
       "     'center': '113.553986,22.224979',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0756',\n",
       "       'adcode': '440404',\n",
       "       'name': '金湾区',\n",
       "       'center': '113.345071,22.139122',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0756',\n",
       "       'adcode': '440403',\n",
       "       'name': '斗门区',\n",
       "       'center': '113.297739,22.209117',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0756',\n",
       "       'adcode': '440402',\n",
       "       'name': '香洲区',\n",
       "       'center': '113.55027,22.271249',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0759',\n",
       "     'adcode': '440800',\n",
       "     'name': '湛江市',\n",
       "     'center': '110.364977,21.274898',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0759',\n",
       "       'adcode': '440811',\n",
       "       'name': '麻章区',\n",
       "       'center': '110.329167,21.265997',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440881',\n",
       "       'name': '廉江市',\n",
       "       'center': '110.284961,21.611281',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440882',\n",
       "       'name': '雷州市',\n",
       "       'center': '110.088275,20.908523',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440883',\n",
       "       'name': '吴川市',\n",
       "       'center': '110.780508,21.428453',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440825',\n",
       "       'name': '徐闻县',\n",
       "       'center': '110.175718,20.326083',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440804',\n",
       "       'name': '坡头区',\n",
       "       'center': '110.455632,21.24441',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440803',\n",
       "       'name': '霞山区',\n",
       "       'center': '110.406382,21.194229',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440823',\n",
       "       'name': '遂溪县',\n",
       "       'center': '110.255321,21.376915',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0759',\n",
       "       'adcode': '440802',\n",
       "       'name': '赤坎区',\n",
       "       'center': '110.361634,21.273365',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0662',\n",
       "     'adcode': '441700',\n",
       "     'name': '阳江市',\n",
       "     'center': '111.975107,21.859222',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0662',\n",
       "       'adcode': '441781',\n",
       "       'name': '阳春市',\n",
       "       'center': '111.7905,22.169598',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0662',\n",
       "       'adcode': '441721',\n",
       "       'name': '阳西县',\n",
       "       'center': '111.617556,21.75367',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0662',\n",
       "       'adcode': '441702',\n",
       "       'name': '江城区',\n",
       "       'center': '111.968909,21.859182',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0662',\n",
       "       'adcode': '441704',\n",
       "       'name': '阳东区',\n",
       "       'center': '112.011267,21.864728',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0750',\n",
       "     'adcode': '440700',\n",
       "     'name': '江门市',\n",
       "     'center': '113.094942,22.590431',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0750',\n",
       "       'adcode': '440784',\n",
       "       'name': '鹤山市',\n",
       "       'center': '112.961795,22.768104',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440704',\n",
       "       'name': '江海区',\n",
       "       'center': '113.120601,22.572211',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440783',\n",
       "       'name': '开平市',\n",
       "       'center': '112.692262,22.366286',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440781',\n",
       "       'name': '台山市',\n",
       "       'center': '112.793414,22.250713',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440785',\n",
       "       'name': '恩平市',\n",
       "       'center': '112.314051,22.182956',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440705',\n",
       "       'name': '新会区',\n",
       "       'center': '113.038584,22.520247',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0750',\n",
       "       'adcode': '440703',\n",
       "       'name': '蓬江区',\n",
       "       'center': '113.07859,22.59677',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0753',\n",
       "     'adcode': '441400',\n",
       "     'name': '梅州市',\n",
       "     'center': '116.117582,24.299112',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0753',\n",
       "       'adcode': '441426',\n",
       "       'name': '平远县',\n",
       "       'center': '115.891729,24.569651',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441427',\n",
       "       'name': '蕉岭县',\n",
       "       'center': '116.170531,24.653313',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441481',\n",
       "       'name': '兴宁市',\n",
       "       'center': '115.731648,24.138077',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441424',\n",
       "       'name': '五华县',\n",
       "       'center': '115.775004,23.925424',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441423',\n",
       "       'name': '丰顺县',\n",
       "       'center': '116.184419,23.752771',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441403',\n",
       "       'name': '梅县区',\n",
       "       'center': '116.083482,24.267825',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441402',\n",
       "       'name': '梅江区',\n",
       "       'center': '116.12116,24.302593',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0753',\n",
       "       'adcode': '441422',\n",
       "       'name': '大埔县',\n",
       "       'center': '116.69552,24.351587',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0668',\n",
       "     'adcode': '440900',\n",
       "     'name': '茂名市',\n",
       "     'center': '110.919229,21.659751',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0668',\n",
       "       'adcode': '440983',\n",
       "       'name': '信宜市',\n",
       "       'center': '110.941656,22.352681',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0668',\n",
       "       'adcode': '440981',\n",
       "       'name': '高州市',\n",
       "       'center': '110.853251,21.915153',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0668',\n",
       "       'adcode': '440904',\n",
       "       'name': '电白区',\n",
       "       'center': '111.007264,21.507219',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0668',\n",
       "       'adcode': '440982',\n",
       "       'name': '化州市',\n",
       "       'center': '110.63839,21.654953',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0668',\n",
       "       'adcode': '440902',\n",
       "       'name': '茂南区',\n",
       "       'center': '110.920542,21.660425',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0768',\n",
       "     'adcode': '445100',\n",
       "     'name': '潮州市',\n",
       "     'center': '116.632301,23.661701',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0768',\n",
       "       'adcode': '445122',\n",
       "       'name': '饶平县',\n",
       "       'center': '117.00205,23.668171',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0768',\n",
       "       'adcode': '445103',\n",
       "       'name': '潮安区',\n",
       "       'center': '116.67931,23.461012',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0768',\n",
       "       'adcode': '445102',\n",
       "       'name': '湘桥区',\n",
       "       'center': '116.63365,23.664675',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0660',\n",
       "     'adcode': '441500',\n",
       "     'name': '汕尾市',\n",
       "     'center': '115.364238,22.774485',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0660',\n",
       "       'adcode': '441523',\n",
       "       'name': '陆河县',\n",
       "       'center': '115.657565,23.302682',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0660',\n",
       "       'adcode': '441521',\n",
       "       'name': '海丰县',\n",
       "       'center': '115.337324,22.971042',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0660',\n",
       "       'adcode': '441502',\n",
       "       'name': '城区',\n",
       "       'center': '115.363667,22.776227',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0660',\n",
       "       'adcode': '441581',\n",
       "       'name': '陆丰市',\n",
       "       'center': '115.644203,22.946104',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0766',\n",
       "     'adcode': '445300',\n",
       "     'name': '云浮市',\n",
       "     'center': '112.044439,22.929801',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0766',\n",
       "       'adcode': '445322',\n",
       "       'name': '郁南县',\n",
       "       'center': '111.535921,23.237709',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0766',\n",
       "       'adcode': '445381',\n",
       "       'name': '罗定市',\n",
       "       'center': '111.578201,22.765415',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0766',\n",
       "       'adcode': '445321',\n",
       "       'name': '新兴县',\n",
       "       'center': '112.23083,22.703204',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0766',\n",
       "       'adcode': '445302',\n",
       "       'name': '云城区',\n",
       "       'center': '112.04471,22.930827',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0766',\n",
       "       'adcode': '445303',\n",
       "       'name': '云安区',\n",
       "       'center': '112.005609,23.073152',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0762',\n",
       "     'adcode': '441600',\n",
       "     'name': '河源市',\n",
       "     'center': '114.697802,23.746266',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0762',\n",
       "       'adcode': '441625',\n",
       "       'name': '东源县',\n",
       "       'center': '114.742711,23.789093',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0762',\n",
       "       'adcode': '441624',\n",
       "       'name': '和平县',\n",
       "       'center': '114.941473,24.44318',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0762',\n",
       "       'adcode': '441622',\n",
       "       'name': '龙川县',\n",
       "       'center': '115.256415,24.101174',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0762',\n",
       "       'adcode': '441623',\n",
       "       'name': '连平县',\n",
       "       'center': '114.495952,24.364227',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0762',\n",
       "       'adcode': '441602',\n",
       "       'name': '源城区',\n",
       "       'center': '114.696828,23.746255',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0762',\n",
       "       'adcode': '441621',\n",
       "       'name': '紫金县',\n",
       "       'center': '115.184383,23.633744',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0663',\n",
       "     'adcode': '445200',\n",
       "     'name': '揭阳市',\n",
       "     'center': '116.355733,23.543778',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0663',\n",
       "       'adcode': '445281',\n",
       "       'name': '普宁市',\n",
       "       'center': '116.165082,23.29788',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0663',\n",
       "       'adcode': '445222',\n",
       "       'name': '揭西县',\n",
       "       'center': '115.838708,23.4273',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0663',\n",
       "       'adcode': '445224',\n",
       "       'name': '惠来县',\n",
       "       'center': '116.295832,23.029834',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0663',\n",
       "       'adcode': '445202',\n",
       "       'name': '榕城区',\n",
       "       'center': '116.357045,23.535524',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0663',\n",
       "       'adcode': '445203',\n",
       "       'name': '揭东区',\n",
       "       'center': '116.412947,23.569887',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0763',\n",
       "     'adcode': '441800',\n",
       "     'name': '清远市',\n",
       "     'center': '113.051227,23.685022',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0763',\n",
       "       'adcode': '441882',\n",
       "       'name': '连州市',\n",
       "       'center': '112.379271,24.783966',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441826',\n",
       "       'name': '连南瑶族自治县',\n",
       "       'center': '112.290808,24.719097',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441825',\n",
       "       'name': '连山壮族瑶族自治县',\n",
       "       'center': '112.086555,24.567271',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441881',\n",
       "       'name': '英德市',\n",
       "       'center': '113.405404,24.18612',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441821',\n",
       "       'name': '佛冈县',\n",
       "       'center': '113.534094,23.866739',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441823',\n",
       "       'name': '阳山县',\n",
       "       'center': '112.634019,24.470286',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441802',\n",
       "       'name': '清城区',\n",
       "       'center': '113.048698,23.688976',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0763',\n",
       "       'adcode': '441803',\n",
       "       'name': '清新区',\n",
       "       'center': '113.015203,23.736949',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0751',\n",
       "     'adcode': '440200',\n",
       "     'name': '韶关市',\n",
       "     'center': '113.591544,24.801322',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0751',\n",
       "       'adcode': '440282',\n",
       "       'name': '南雄市',\n",
       "       'center': '114.311231,25.115328',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440232',\n",
       "       'name': '乳源瑶族自治县',\n",
       "       'center': '113.278417,24.776109',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440224',\n",
       "       'name': '仁化县',\n",
       "       'center': '113.748627,25.088226',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440233',\n",
       "       'name': '新丰县',\n",
       "       'center': '114.207034,24.055412',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440222',\n",
       "       'name': '始兴县',\n",
       "       'center': '114.067205,24.948364',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440229',\n",
       "       'name': '翁源县',\n",
       "       'center': '114.131289,24.353887',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440204',\n",
       "       'name': '浈江区',\n",
       "       'center': '113.599224,24.803977',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440203',\n",
       "       'name': '武江区',\n",
       "       'center': '113.588289,24.80016',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440205',\n",
       "       'name': '曲江区',\n",
       "       'center': '113.605582,24.680195',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '0751',\n",
       "       'adcode': '440281',\n",
       "       'name': '乐昌市',\n",
       "       'center': '113.352413,25.128445',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '020',\n",
       "     'adcode': '440100',\n",
       "     'name': '广州市',\n",
       "     'center': '113.280637,23.125178',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '020',\n",
       "       'adcode': '440117',\n",
       "       'name': '从化区',\n",
       "       'center': '113.587386,23.545283',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440114',\n",
       "       'name': '花都区',\n",
       "       'center': '113.211184,23.39205',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440115',\n",
       "       'name': '南沙区',\n",
       "       'center': '113.53738,22.794531',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440113',\n",
       "       'name': '番禺区',\n",
       "       'center': '113.364619,22.938582',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440111',\n",
       "       'name': '白云区',\n",
       "       'center': '113.262831,23.162281',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440105',\n",
       "       'name': '海珠区',\n",
       "       'center': '113.262008,23.103131',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440103',\n",
       "       'name': '荔湾区',\n",
       "       'center': '113.243038,23.124943',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440118',\n",
       "       'name': '增城区',\n",
       "       'center': '113.829579,23.290497',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440104',\n",
       "       'name': '越秀区',\n",
       "       'center': '113.280714,23.125624',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440106',\n",
       "       'name': '天河区',\n",
       "       'center': '113.335367,23.13559',\n",
       "       'level': 'district',\n",
       "       'districts': []},\n",
       "      {'citycode': '020',\n",
       "       'adcode': '440112',\n",
       "       'name': '黄埔区',\n",
       "       'center': '113.450761,23.103239',\n",
       "       'level': 'district',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0760',\n",
       "     'adcode': '442000',\n",
       "     'name': '中山市',\n",
       "     'center': '113.382391,22.521113',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '三角镇',\n",
       "       'center': '113.416,22.7079',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '横栏镇',\n",
       "       'center': '113.224,22.6048',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '五桂山街道',\n",
       "       'center': '113.399,22.4847',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '东升镇',\n",
       "       'center': '113.321,22.5607',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '神湾镇',\n",
       "       'center': '113.376,22.2768',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '火炬开发区街道',\n",
       "       'center': '113.42,22.5577',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '小榄镇',\n",
       "       'center': '113.23,22.7026',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '南朗镇',\n",
       "       'center': '113.482,22.519',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '古镇镇',\n",
       "       'center': '113.167,22.6751',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '民众镇',\n",
       "       'center': '113.499,22.6855',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '港口镇',\n",
       "       'center': '113.354,22.6027',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '三乡镇',\n",
       "       'center': '113.432,22.3879',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '石岐区街道',\n",
       "       'center': '113.405,22.5247',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '大涌镇',\n",
       "       'center': '113.297,22.4834',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '南头镇',\n",
       "       'center': '113.328,22.6882',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '黄圃镇',\n",
       "       'center': '113.329,22.7457',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '东区街道',\n",
       "       'center': '113.4,22.5274',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '阜沙镇',\n",
       "       'center': '113.34,22.6406',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '西区街道',\n",
       "       'center': '113.314,22.5649',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '坦洲镇',\n",
       "       'center': '113.38,22.2868',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '板芙镇',\n",
       "       'center': '113.358,22.4068',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '南区街道',\n",
       "       'center': '113.367,22.4892',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '沙溪镇',\n",
       "       'center': '113.344,22.5248',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0760',\n",
       "       'adcode': '442000',\n",
       "       'name': '东凤镇',\n",
       "       'center': '113.308,22.6803',\n",
       "       'level': 'street',\n",
       "       'districts': []}]},\n",
       "    {'citycode': '0769',\n",
       "     'adcode': '441900',\n",
       "     'name': '东莞市',\n",
       "     'center': '113.746262,23.046237',\n",
       "     'level': 'city',\n",
       "     'districts': [{'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '莞城街道',\n",
       "       'center': '113.743,23.0225',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '常平镇',\n",
       "       'center': '114.036,23.0074',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '望牛墩镇',\n",
       "       'center': '113.676,23.0683',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '大朗镇',\n",
       "       'center': '113.939,22.8654',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '麻涌镇',\n",
       "       'center': '113.562,22.9718',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '东莞生态园',\n",
       "       'center': '113.917,23.0806',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '桥头镇',\n",
       "       'center': '114.065,23.0315',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '樟木头镇',\n",
       "       'center': '114.018,22.8704',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '松山湖管委会',\n",
       "       'center': '113.875,22.869',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '凤岗镇',\n",
       "       'center': '114.105,22.7308',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '石龙镇',\n",
       "       'center': '113.833,23.1123',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '高埗镇',\n",
       "       'center': '113.773,23.112',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '塘厦镇',\n",
       "       'center': '114.05,22.7713',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '寮步镇',\n",
       "       'center': '113.888,22.9529',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '厚街镇',\n",
       "       'center': '113.776,22.9097',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '谢岗镇',\n",
       "       'center': '114.128,22.9901',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '虎门镇',\n",
       "       'center': '113.797,22.8587',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '南城街道',\n",
       "       'center': '113.737,23.0249',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '虎门港管委会',\n",
       "       'center': '113.562,22.9718',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '横沥镇',\n",
       "       'center': '114.006,23.0504',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '企石镇',\n",
       "       'center': '113.99,23.0541',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '东坑镇',\n",
       "       'center': '113.918,22.995',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '石排镇',\n",
       "       'center': '113.988,23.068',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '东城街道',\n",
       "       'center': '113.757,23.0485',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '洪梅镇',\n",
       "       'center': '113.607,23.0155',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '沙田镇',\n",
       "       'center': '113.582,22.9426',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '道滘镇',\n",
       "       'center': '113.692,23.004',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '大岭山镇',\n",
       "       'center': '113.843,22.9534',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '清溪镇',\n",
       "       'center': '114.11,22.862',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '茶山镇',\n",
       "       'center': '113.839,23.0813',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '中堂镇',\n",
       "       'center': '113.734,23.1164',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '万江街道',\n",
       "       'center': '113.709,23.0014',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '石碣镇',\n",
       "       'center': '113.846,23.1024',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '长安镇',\n",
       "       'center': '113.714,22.7863',\n",
       "       'level': 'street',\n",
       "       'districts': []},\n",
       "      {'citycode': '0769',\n",
       "       'adcode': '441900',\n",
       "       'name': '黄江镇',\n",
       "       'center': '113.977,22.8091',\n",
       "       'level': 'street',\n",
       "       'districts': []}]}]}]}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广东省 = district(yan_key,\"广东省\",2,\"base\")\n",
    "广东省"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "## 搜索POI\n",
    "\n",
    "搜索服务API是一类简单的HTTP接口，提供多种查询POI信息的能力，其中包括关键字搜索、周边搜索、多边形搜索、ID查询四种筛选机制。\n",
    "#### 关键词搜索\n",
    " 通过用POI的关键字进行条件搜索，例如：肯德基、朝阳公园等；同时支持设置POI类型搜索，例如：银行\n",
    "\n",
    "1.url:https://restapi.amap.com/v3/place/text?parameters\n",
    "\n",
    "2.requests.get()\n",
    "\n",
    "3.参数：\n",
    "\n",
    "必填：key，keywords,types\n",
    "可选：city,children"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def POI(key,keywords,types=None,city=None,children=None)->dict:\n",
    "    POI_url = \"https://restapi.amap.com/v3/place/text?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"keywords\":keywords,\n",
    "        \"types\":types,\n",
    "        \"city\":city,\n",
    "        \"children\":children\n",
    "    }\n",
    "    r = requests.get(POI_url,params = params)\n",
    "    # 返回值\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '154',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'address': '温泉大道882号',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': '3.5'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/6cb6683be58d514bc02a80c1dbd2ff05'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ca4a133bec5f0f26fd4d6d694c25d10f'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/83c34f0b230b189a03ea87dc42c728c3'}],\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院',\n",
       "   'location': '113.679262,23.632583',\n",
       "   'tel': '020-61787331',\n",
       "   'shopid': [],\n",
       "   'id': 'B00140MR9A'},\n",
       "  {'parent': 'B0FFMCZOK0',\n",
       "   'address': '温泉大道882',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': '内景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/1c2d1e52ba36676df1ac79560870a449'},\n",
       "    {'provider': [],\n",
       "     'title': '外景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ee41674102735aff85adf9ddaddece23'},\n",
       "    {'provider': [],\n",
       "     'title': '外景图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/9f3e339845eb6a4bcdbd6d02b964ec3f'}],\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'childtype': '101',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院(西北门)',\n",
       "   'location': '113.672109,23.643371',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B00141JCWL'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [],\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院',\n",
       "   'location': '113.671493,23.643831',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFMCZOK0'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '温泉大道886号中山大学南方学院内',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;学校',\n",
       "   'photos': [],\n",
       "   'typecode': '141200',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院-综合楼',\n",
       "   'location': '113.680117,23.631544',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFF2VMJ4'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '中山路',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://aos-cdn-image.amap.com/sns/ugccomment/86367a6a-0f26-42ad-954b-29c35fc1815e.jpg'}],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院音乐系',\n",
       "   'location': '113.678792,23.635389',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKPXMCN'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '温泉大道882号',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [],\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'childtype': '101',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院(东南门)',\n",
       "   'location': '113.678733,23.628290',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFK8J7XY'},\n",
       "  {'parent': 'B0FFMCZOK0',\n",
       "   'address': '温泉大道882',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '通行设施;临街院门;临街院门',\n",
       "   'photos': [],\n",
       "   'typecode': '991400',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'childtype': '101',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院(正门)',\n",
       "   'location': '113.671663,23.643941',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0G06MOP96'},\n",
       "  {'parent': [],\n",
       "   'address': '神岗镇',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;小学',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://aos-cdn-image.amap.com/sns/ugccomment/d4e41dff-4819-42a4-9f7c-47b9c3d6c371.jpg'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://aos-cdn-image.amap.com/sns/ugccomment/12bccf8b-1032-4dbb-9022-5f55cad6e599.jpg'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://aos-cdn-image.amap.com/sns/ugccomment/0f997134-d240-42b3-a53d-1290c3f44083.jpg'}],\n",
       "   'typecode': '141203',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院附属小学',\n",
       "   'location': '113.522758,23.473157',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLA7KQW'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路4附近',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院西区饭堂',\n",
       "   'location': '113.676210,23.632177',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFJLW0O9'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉大道882号中山大学南方学院',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;学校',\n",
       "   'photos': [],\n",
       "   'typecode': '141200',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院-综合楼',\n",
       "   'location': '113.677892,23.628958',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLFILKM'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '中山大学南方学院',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼9号',\n",
       "   'location': '113.679747,23.633032',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLFIY0N'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路21',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼2号',\n",
       "   'location': '113.677060,23.631346',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B00141TRVH'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/6b851561752346ec9af53fbf0feff00b'}],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼10号',\n",
       "   'location': '113.680125,23.633492',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFFTC9PH'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '温泉大道882号中山大学南方学院',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://aos-cdn-image.amap.com/sns/ugccomment/45529964-d5a3-4975-b0d7-98c8f2df8651.jpg'}],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院-第11教学楼',\n",
       "   'location': '113.680037,23.633173',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFJKIA10'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/7e3c213f780dfbc053850c212d2268ff'}],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼8号',\n",
       "   'location': '113.680399,23.634329',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B00141WQCO'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路7',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;学校;高等院校',\n",
       "   'photos': [],\n",
       "   'typecode': '141201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼7号',\n",
       "   'location': '113.678600,23.633330',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B00141TQGR'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路29',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院教学楼4号',\n",
       "   'location': '113.677460,23.630490',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B00141TR76'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '温泉大道882号中山大学南方学院新综合楼二楼',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院达人书院',\n",
       "   'location': '113.679041,23.632392',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFM4JIF8'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '博学路附近',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院1号实验楼',\n",
       "   'location': '113.678215,23.631370',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKP9ET5'},\n",
       "  {'parent': 'B00140MR9A',\n",
       "   'address': '温泉镇博学路中山大学南方学院9号教学楼',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '309',\n",
       "   'adname': '从化区',\n",
       "   'name': '中山大学南方学院-政商研究院',\n",
       "   'location': '113.680427,23.633994',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFL9B0QY'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "POI(yan_key,\"中山大学南方学院\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 周边搜索\\\n",
    "在用户传入经纬度坐标点附近，在设定的范围内，按照关键字或POI类型搜索\n",
    "\n",
    "1.url:https://restapi.amap.com/v3/place/around?parameters \n",
    "\n",
    "2.requests.get()\n",
    "\n",
    "3.参数：\n",
    "必填：key,location\n",
    "可选：keywords"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def around(key,location,keywords=None)->dict:\n",
    "    around_url = \"https://restapi.amap.com/v3/place/around?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"location\":location,\n",
    "        \"keywords\":keywords,\n",
    "    }\n",
    "    r = requests.get(around_url,params = params)\n",
    "    # 返回值\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '831',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'address': '温泉镇笃行路20、22、24号中山大学南方学院',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '生活服务;共享设备;充电宝',\n",
       "   'photos': [],\n",
       "   'typecode': '072101',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '街电(榴芒一族中山大学南方学院店)',\n",
       "   'location': '113.679287,23.632575',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLB846S'},\n",
       "  {'parent': [],\n",
       "   'address': '从化温泉镇中山大学南方学院博学路6号',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050118',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '爽爽石磨肠粉',\n",
       "   'location': '113.679287,23.632575',\n",
       "   'tel': '18218913303',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKX3T5Y'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院明辨路2号二、三层',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '避风塘',\n",
       "   'location': '113.679286,23.632574',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKT2R96'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院明辨路2号二、三层',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': 'slim tea',\n",
       "   'location': '113.679286,23.632574',\n",
       "   'tel': '18944690066',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKSLFAN'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050118',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '劲酷烤吧',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13719231627',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3AYBO5X'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;广东菜(粤菜)',\n",
       "   'photos': [],\n",
       "   'typecode': '050103',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '东记乡村美食',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13922398107',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3APADKJ'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050300',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '北方饺子馆',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13434241448',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G2Z7IX80'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '第1烤场',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13538825321',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G2K6PX0X'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '叶龙老武汉烧烤',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '15918718710;13125030232',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G1393J7X'},\n",
       "  {'parent': [],\n",
       "   'address': '从化温泉镇中山大学南方学院明辩路2号',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': '1.0', 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '网红小串店',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13802426981',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLNRH1K'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '过气轻食屋',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13049636920',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKTDMOI'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;餐饮相关场所;餐饮相关',\n",
       "   'photos': [],\n",
       "   'typecode': '050000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '莫凡烧烤',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '13929768267',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKT4WNY'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉大道882号旁润泰超市一楼商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;冷饮店;冷饮店',\n",
       "   'photos': [],\n",
       "   'typecode': '050700',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': 'LV柠檬茶',\n",
       "   'location': '113.679286,23.632573',\n",
       "   'tel': '15018428578',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFIIQNQ7'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;甜品店;甜品店',\n",
       "   'photos': [],\n",
       "   'typecode': '050900',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '味美轩(中大店)',\n",
       "   'location': '113.679286,23.632571',\n",
       "   'tel': '15915874513',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G2T96S9V'},\n",
       "  {'parent': [],\n",
       "   'address': '中山大学南方学院',\n",
       "   'distance': '0',\n",
       "   'biz_ext': {'cost': [], 'rating': '4.7', 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;四川菜(川菜)',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/20080ba9f6fcd2808d64ce149b517ca9'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/9f40694ca108a175d36847d03ecf4ec0'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/db33127b3da2ffeeabb9bde1157e33cf'}],\n",
       "   'typecode': '050102',\n",
       "   'shopinfo': '1',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '重庆湖边纸包鱼',\n",
       "   'location': '113.679871,23.630292',\n",
       "   'tel': '13924024938',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFL7NUA2'},\n",
       "  {'parent': [],\n",
       "   'address': '博学路中山大学南方学院后门润泰超市首层23号',\n",
       "   'distance': '1',\n",
       "   'biz_ext': {'cost': [], 'rating': '3.0', 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050300',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '我家厨房',\n",
       "   'location': '113.679289,23.632563',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFK28XPU'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉大道882号',\n",
       "   'distance': '2',\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '广州市',\n",
       "   'type': '生活服务;共享设备;充电宝',\n",
       "   'photos': [],\n",
       "   'typecode': '072101',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '怪兽充电(中山大学南方学院)',\n",
       "   'location': '113.679262,23.632583',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLLU813'},\n",
       "  {'parent': [],\n",
       "   'address': '温泉镇博学路中山大学南方学院后门润泰超市一楼05号商铺',\n",
       "   'distance': '9',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;外国餐厅;日本料理',\n",
       "   'photos': [],\n",
       "   'typecode': '050202',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '井禾寿司',\n",
       "   'location': '113.679193,23.632552',\n",
       "   'tel': '13789117723',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G14PDQVA'},\n",
       "  {'parent': [],\n",
       "   'address': '中山大学南方学院',\n",
       "   'distance': '12',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/b18ad10223dfdcbd28e244ef56a3229e'}],\n",
       "   'typecode': '050201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': 'Uni-hotel西餐',\n",
       "   'location': '113.679224,23.632671',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0GR3OMDZ2'},\n",
       "  {'parent': [],\n",
       "   'address': '从化温泉镇中山大学南方学院明辩路2号',\n",
       "   'distance': '16',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广东省',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '广州市',\n",
       "   'type': '餐饮服务;中餐厅;广东菜(粤菜)',\n",
       "   'photos': [],\n",
       "   'typecode': '050103',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '从化区',\n",
       "   'name': '耀记美食',\n",
       "   'location': '113.679405,23.632673',\n",
       "   'tel': '18816801934',\n",
       "   'shopid': [],\n",
       "   'id': 'B0GRGOTLSL'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "around(yan_key,'113.679287,23.632575')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  多边形搜索\n",
    "在多边形区域内进行搜索\n",
    "\n",
    "1.url:https://restapi.amap.com/v3/place/polygon?parameters  \n",
    "\n",
    "2.requests.get()\n",
    "\n",
    "3.参数：\n",
    "必填：key,polygon\n",
    "可选：keywords"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "def polygon(key,polygon,keywords=None)->dict:\n",
    "    polygon_url = \"https://restapi.amap.com/v3/place/polygon?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"polygon\":polygon,\n",
    "        \"keywords\":keywords,\n",
    "    }\n",
    "    r = requests.get(polygon_url,params = params)\n",
    "    # 返回值\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '3',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'address': '望京西园4区410号综合楼1层',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': '41.00', 'rating': '4.2', 'meal_ordering': '0'},\n",
       "   'pname': '北京市',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '北京市',\n",
       "   'type': '餐饮服务;快餐厅;肯德基',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/13a1e79236cf21712227f16947c91930'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/80025d84d06dcd5f469447b38884cb36'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/19052eb9143e5a21b9abe93d033ed9c5'}],\n",
       "   'typecode': '050301',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '朝阳区',\n",
       "   'name': '肯德基(望京西店)',\n",
       "   'location': '116.474027,39.997731',\n",
       "   'tel': '17810627435;4009208801',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFKEPXS2'},\n",
       "  {'parent': 'B0FFG4VQTD',\n",
       "   'address': '望京南湖东园201号楼1层',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': '43.00', 'rating': '4.5', 'meal_ordering': '0'},\n",
       "   'pname': '北京市',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '北京市',\n",
       "   'type': '餐饮服务;快餐厅;肯德基',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/13a1e79236cf21712227f16947c91930'},\n",
       "    {'provider': [],\n",
       "     'title': '香辣鸡腿堡',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/aff3c644629ee9e3502589915f471c35'},\n",
       "    {'provider': [],\n",
       "     'title': '新奥尔良烤翅',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/55fe83c00e1ee57f5030f38dd07fe7ec'}],\n",
       "   'typecode': '050301',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '朝阳区',\n",
       "   'name': '肯德基(中福百货店)',\n",
       "   'location': '116.463373,40.000423',\n",
       "   'tel': '010-64753305;4009208801;010-64753306',\n",
       "   'shopid': [],\n",
       "   'id': 'B000A7FVJQ'},\n",
       "  {'parent': 'B0FFF5UV26',\n",
       "   'address': '花家地小区1号商业楼',\n",
       "   'distance': [],\n",
       "   'biz_ext': {'cost': '41.00', 'rating': '4.5', 'meal_ordering': '0'},\n",
       "   'pname': '北京市',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '北京市',\n",
       "   'type': '餐饮服务;快餐厅;肯德基',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/13a1e79236cf21712227f16947c91930'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/5adc19aa58cf8ba9245e7cb826d95ab3'},\n",
       "    {'provider': [],\n",
       "     'title': '菜品',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/8ed35a41bebfc69449f1fca61e20e618'}],\n",
       "   'typecode': '050301',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '朝阳区',\n",
       "   'name': '肯德基(花家地店)',\n",
       "   'location': '116.469263,39.985284',\n",
       "   'tel': '4009200715',\n",
       "   'shopid': [],\n",
       "   'id': 'B000A7BM4H'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "polygon(yan_key,\"116.460988,40.006919|116.48231,40.007381;116.47516,39.99713|116.472596,39.985227|116.45669,39.984989|116.460988,40.006919\",\"肯德基\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### ID查询\n",
    "通过POI ID，查询某个POI详情，建议可同输入提示API配合使用\n",
    "\n",
    "1.url:https://restapi.amap.com/v3/place/detail?parameters  \n",
    "\n",
    "2.requests.get()\n",
    "\n",
    "3.参数：\n",
    "必填：key,id\n",
    "可选：sig,output\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "def detail(key,id,sig=None,output=None)->dict:\n",
    "    detail_url = \"https://restapi.amap.com/v3/place/detail?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"id\":id,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output\n",
    "    }\n",
    "    r = requests.get(detail_url,params = params)\n",
    "    # 返回值\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'count': '1',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'distance': [],\n",
       "   'pcode': '110000',\n",
       "   'importance': [],\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'recommend': '0',\n",
       "   'type': '商务住宅;楼宇;商务写字楼',\n",
       "   'photos': [{'title': '效果图',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a9836f620749c34742cf1ab67dc98f08'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53b11166a310a21470acde3a'},\n",
       "    {'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/53b11166a310a21470acde31'}],\n",
       "   'discount_num': '0',\n",
       "   'gridcode': '5916739702',\n",
       "   'typecode': '120201',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'deep_info': {'deepsrc': []},\n",
       "   'citycode': '010',\n",
       "   'adname': '朝阳区',\n",
       "   'indoor_src': '高德地图',\n",
       "   'children': [],\n",
       "   'tel': [],\n",
       "   'id': 'B0FFFAB6J2',\n",
       "   'tag': [],\n",
       "   'event': [],\n",
       "   'entr_location': '116.473993,39.992784',\n",
       "   'indoor_map': '1',\n",
       "   'email': [],\n",
       "   'timestamp': '2020-11-17 14:09:17',\n",
       "   'website': [],\n",
       "   'address': '阜荣街10号',\n",
       "   'adcode': '110105',\n",
       "   'pname': '北京市',\n",
       "   'biz_type': [],\n",
       "   'cityname': '北京市',\n",
       "   'postcode': [],\n",
       "   'match': '0',\n",
       "   'business_area': '望京',\n",
       "   'indoor_data': {'cmsid': 'TY000191_B0FFFAB6J2',\n",
       "    'truefloor': [],\n",
       "    'cpid': 'B0FFFAB6J2',\n",
       "    'floor': []},\n",
       "   'childtype': [],\n",
       "   'rich_content': [],\n",
       "   'exit_location': [],\n",
       "   'name': '首开广场',\n",
       "   'location': '116.473004,39.993306',\n",
       "   'shopid': [],\n",
       "   'navi_poiid': 'J50F001020_342662',\n",
       "   'groupbuy_num': '0'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "detail(yan_key,\"B0FFFAB6J2\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##  IP定位\n",
    "IP定位是一个简单的HTTP接口，根据用户输入的IP地址，能够快速的帮用户定位IP的所在位置。\n",
    "\n",
    "1.url:https://restapi.amap.com/v3/ip?parameters\n",
    "\n",
    "2.requests.get()\n",
    "\n",
    "3.参数：\n",
    "\n",
    "必填：key\n",
    "可选：ip,sig,output"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "def ip(key,ip=None,sig=None,output=None)->dict:\n",
    "    ip_url = \"https://restapi.amap.com/v3/ip?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"ip\":ip,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output\n",
    "    }\n",
    "    r = requests.get(ip_url,params = params)\n",
    "    # 返回值\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'province': '北京市',\n",
       " 'city': '北京市',\n",
       " 'adcode': '110000',\n",
       " 'rectangle': '116.0119343,39.66127144;116.7829835,40.2164962'}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ip(yan_key,\"114.247.50.2\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 静态地图\n",
    "\n",
    "1.url:https://restapi.amap.com/v3/staticmap?parameters\n",
    "\n",
    "2.requests.get()\n",
    "\n",
    "3.参数：\n",
    "\n",
    "必填：key,location,zoom\n",
    "可选：size,scale"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "from PIL import Image\n",
    "from io import BytesIO\n",
    "def staticmap(location,zoom,size=None,scale=1,markers=None,labels=None,paths=None,traffic=0,page=None,sig=None)->dict:\n",
    "    url = 'https://restapi.amap.com/v3/staticmap?parameters'\n",
    "    params={\n",
    "        'key':yan_key,\n",
    "        'location':location,\n",
    "        'zoom':zoom,\n",
    "        'size':size,\n",
    "        'scale':scale,\n",
    "        'markers':markers,\n",
    "        'labels':labels,\n",
    "        'paths':paths,\n",
    "        'traffic':traffic,\n",
    "        'sig':sig,\n",
    "        'output':'json'\n",
    "    }\n",
    "    response = requests.get(url,params=params)\n",
    "    data = Image.open(BytesIO(response.content))\n",
    "    return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAADAFBMVEX59/HW1dP67sdNTlH28+q31fnAurfj4+K6t7Lvx1Lx8fH+/v2VlZb7/PT9+f2vrahKsVr73cfpp0+ampv25sru8vr3hjD39O32l0z9yDD3/OGWlJJPstftyIb29O+qqqrV5vT1fyXOzcvX5ffz9ufKwIvz8/I1hChaW1z58ePis2Cdm5j6zamt0Pv4oFl0q2z4qmrE2cD3iTTh3tr607H7+vp2y9bHx8anzf31izm2w67n7fK2tbTu7tbLy8qXl5YinAbyxnv75dL8vnr+UUvr6urE4ZnsvWn64cr3rHHruWKRcUj617rT0tLv1af0hzPD2/n4uYU1wqVwWT3kuXPc29m4uLj67N3Z6Nbe5bXb6cjq6elxcnN1TBr4ol9uQg1ocG/k7+f1ijf11KnM7OdKSUkal2z3jz/5kkP69Oo6kynl7NzU1NT1zYnuwHLn9vX6xZrKycn5yqTDy5i4t7b63MKih2a907WzsrGvtKnuwnvNxbzi4uLi6/S/v73ruWPr6+r5p2bW1tWampn15MT59OzZ2dnDw8NspWL67+NlZmjm49lHjzv0+Pn1m1Xq5uD5t4Pp28af1YWVlJOjoqFhYWCGyajP1c2lpKNeh1eYeV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vuGSOwc8SHx0v5FezTdn9R0XjS0GPohrKnwOV+ksddw498yrk8aqyzlwgRIO+N9R75xMxshuufglYiHKh8rmHv77X8NOG8p/9Ba2X+7jIQCeU6UCeiIfsFipeAnnvSy8tVG3/t5oHQG/Etvwllnj8+C9fPAFiBWn3qWup86UnQKZeRmZQpc6ubZqniYwAWTjbdqybFvr/AcG+0ntX5UcIAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<PIL.PngImagePlugin.PngImageFile image mode=P size=400x400 at 0x21254EEF7F0>"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "zdnf_map = staticmap(location='113.679287,23.632575', zoom=12)\n",
    "zdnf_map"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 坐标转换\n",
    "坐标转换是一类简单的HTTP接口，能够将用户输入的非高德坐标（GPS坐标、mapbar坐标、baidu坐标）转换成高德坐标。\n",
    "\n",
    "1.url:https://restapi.amap.com/v3/assistant/coordinate/convert?parameters\n",
    "\n",
    "2.requests.get()\n",
    "\n",
    "3.参数：\n",
    "\n",
    "必填：key,locations\n",
    "可选：coordsys,sig,output"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "def convert(key,locations,coordsys=None,sig=None,output=None)->dict:\n",
    "    convert_url = 'https://restapi.amap.com/v3/assistant/coordinate/convert?parameters'\n",
    "    params={\n",
    "        \"key\":key,\n",
    "        \"locations\":locations,\n",
    "        \"coordsys\":coordsys,\n",
    "        \"sig\":sig,\n",
    "        \"output\":output\n",
    "    }\n",
    "    r = requests.get(convert_url,params = params)\n",
    "    # 返回值\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'ok',\n",
       " 'infocode': '10000',\n",
       " 'locations': '116.481499,39.990475|116.481499,39.990375'}"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "convert(yan_key,\"116.481499,39.990475|116.481499,39.990375\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##  天气查询\n",
    "天气查询是一个简单的HTTP接口，根据用户输入的adcode，查询目标区域当前/未来的天气情况。\n",
    "\n",
    "1.url:https://restapi.amap.com/v3/weather/weatherInfo?parameters\n",
    "\n",
    "2.requests.get()\n",
    "\n",
    "3.参数：\n",
    "\n",
    "必填：key,city\n",
    "可选：extensions,output"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "def weather(key,city,extensions=None,output=None)->dict:\n",
    "    weather_url = \"https://restapi.amap.com/v3/weather/weatherInfo?parameters\"\n",
    "    params={\n",
    "        \"key\":key,\n",
    "        \"city\":city,\n",
    "        \"extensions\":extensions,\n",
    "        \"output\":output\n",
    "    }\n",
    "    r = requests.get(weather_url,params = params)\n",
    "    # 返回值\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'count': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'lives': [{'province': '广东',\n",
       "   'city': '广州市',\n",
       "   'adcode': '440100',\n",
       "   'weather': '晴',\n",
       "   'temperature': '23',\n",
       "   'winddirection': '北',\n",
       "   'windpower': '≤3',\n",
       "   'humidity': '86',\n",
       "   'reporttime': '2020-11-17 21:52:46'}]}"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weather(yan_key,\"广州市\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 输入提示\n",
    " 输入提示是一类简单的HTTP接口，提供根据用户输入的关键词查询返回建议列表。\n",
    "\n",
    "1.url:https://restapi.amap.com/v3/assistant/inputtips?parameters\n",
    "\n",
    "2.requests.get()\n",
    "\n",
    "3.参数：\n",
    "必填：key，keywords\n",
    "可选：type,location,city"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "def tip(key,keywords,type=None,location=None,city=None)->dict:\n",
    "    tip_url = \"https://restapi.amap.com/v3/assistant/inputtips?parameters\"\n",
    "    params={\n",
    "        \"key\":key,\n",
    "        \"keywords\":keywords,\n",
    "        \"type\":type,\n",
    "        \"location\":location,\n",
    "        \"city\":city,\n",
    "    }\n",
    "    r = requests.get(tip_url,params = params)\n",
    "    # 返回值\n",
    "    result = r.json()\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'count': '10',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'tips': [{'id': 'B036706ZVC',\n",
       "   'name': '麦当劳(春城得来速店)',\n",
       "   'district': '云南省昆明市官渡区',\n",
       "   'adcode': '530111',\n",
       "   'location': '102.726178,25.018438',\n",
       "   'address': '春城路166-168号上海沙龙首层',\n",
       "   'typecode': '050302',\n",
       "   'city': []},\n",
       "  {'id': 'B001C7XFZZ',\n",
       "   'name': '麦当劳(郫都区店)',\n",
       "   'district': '四川省成都市金牛区',\n",
       "   'adcode': '510106',\n",
       "   'location': '103.978189,30.724212',\n",
       "   'address': '蜀西路399号',\n",
       "   'typecode': '050300',\n",
       "   'city': []},\n",
       "  {'id': 'B001C806EK',\n",
       "   'name': '麦当劳(欢乐谷店)',\n",
       "   'district': '四川省成都市金牛区',\n",
       "   'adcode': '510106',\n",
       "   'location': '104.035489,30.719447',\n",
       "   'address': '沙西线1号华侨城公园广场',\n",
       "   'typecode': '050302',\n",
       "   'city': []},\n",
       "  {'id': 'B0FFF6RH4F',\n",
       "   'name': '麦当劳(地铁中心城店)',\n",
       "   'district': '四川省成都市青羊区',\n",
       "   'adcode': '510105',\n",
       "   'location': '104.065310,30.657614',\n",
       "   'address': '天府广场B1层',\n",
       "   'typecode': '050302',\n",
       "   'city': []},\n",
       "  {'id': 'B001C8059O',\n",
       "   'name': '麦当劳(软件园DT餐厅)',\n",
       "   'district': '四川省成都市武侯区',\n",
       "   'adcode': '510107',\n",
       "   'location': '104.070686,30.542893',\n",
       "   'address': '天府大道中段801号,天府软件园B区',\n",
       "   'typecode': '050302',\n",
       "   'city': []},\n",
       "  {'id': 'B001C80DKS',\n",
       "   'name': '麦当劳(五桂桥餐厅)',\n",
       "   'district': '四川省成都市成华区',\n",
       "   'adcode': '510108',\n",
       "   'location': '104.128358,30.636119',\n",
       "   'address': '迎晖路194号五桂桥客运站内',\n",
       "   'typecode': '050302',\n",
       "   'city': []},\n",
       "  {'id': 'B001C8OFKY',\n",
       "   'name': '麦当劳(成都东站)',\n",
       "   'district': '四川省成都市成华区',\n",
       "   'adcode': '510108',\n",
       "   'location': '104.143451,30.628907',\n",
       "   'address': '青衣江路成都东站候车大厅2层',\n",
       "   'typecode': '050302',\n",
       "   'city': []},\n",
       "  {'id': 'B001786OHS',\n",
       "   'name': '麦当劳(鲁能星城得来速店)',\n",
       "   'district': '重庆市渝北区',\n",
       "   'adcode': '500112',\n",
       "   'location': '106.560443,29.594875',\n",
       "   'address': '渝鲁大道666号鲁能新城7街区1层',\n",
       "   'typecode': '050302',\n",
       "   'city': []},\n",
       "  {'id': 'B001D0YL8Z',\n",
       "   'name': '麦当劳(北客站北店)',\n",
       "   'district': '陕西省西安市未央区',\n",
       "   'adcode': '610112',\n",
       "   'location': '108.938634,34.378386',\n",
       "   'address': '文景路北口西安北站F3层',\n",
       "   'typecode': '050302',\n",
       "   'city': []},\n",
       "  {'id': 'B0FFF657F1',\n",
       "   'name': '麦当劳(金莎国际店)',\n",
       "   'district': '陕西省西安市雁塔区',\n",
       "   'adcode': '610113',\n",
       "   'location': '108.947617,34.225757',\n",
       "   'address': '长安中路65号金莎国际广场一层',\n",
       "   'typecode': '050302',\n",
       "   'city': []}]}"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tip(yan_key,\"麦当劳\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
